Spaces:
Runtime error
Runtime error
#!/usr/bin/env python | |
from __future__ import annotations | |
import argparse | |
import functools | |
import os | |
import pickle | |
import sys | |
import gradio as gr | |
import numpy as np | |
import torch | |
import torch_utils | |
import torch.nn as nn | |
from huggingface_hub import hf_hub_download | |
from transformers import pipeline | |
sys.path.insert(0, 'StyleGAN-Human') | |
TITLE = 'Time-TravelRephotography' | |
DESCRIPTION = '''This is an unofficial demo for https://github.com/Time-Travel-Rephotography. | |
''' | |
ARTICLE = '<center><img src="https://visitor-badge.glitch.me/badge?page_id=hysts.stylegan-human" alt="visitor badge"/></center>' | |
TOKEN = "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" | |
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es") | |
def predict(text): | |
return pipe(text)[0]["translation_text"] | |
iface = gr.Interface( | |
fn=predict, | |
inputs='text', | |
outputs='text', | |
examples=[["Time-TravelRephotography"]] | |
) | |
iface.launch() |