viddlr / app.py
charliebaby2023's picture
Update app.py
fe64e29 verified
raw
history blame
No virus
790 Bytes
from youtube_video import download_youtube_video
import requests
from huggingface_hub import InferenceClient
import gradio as gr
data = 'https://www.youtube.com/watch?v=ETDEuH3YL7I' #'https://www.youtube.com/watch?v=bJ5FDtgOwjo'
client = InferenceClient(model="http://127.0.0.1:8080")
client.text_generation(prompt="Write a code for snake game")
def app(video_link):
video_path = download_youtube_video(video_link)
return video_path
interface = gr.Interface(
fn=app,
inputs=gr.Textbox(data, label="Enter YouTube link"),
outputs=gr.Video(label = "video_path")
)
#gr.Interface.queue(api_open=True)
token = 'hi'
for token in client.text_generation("How do you make cheese?", max_new_tokens=12, stream=True):
print(token)
interface.launch(debug=True)