Spaces:
Runtime error
Runtime error
Commit
•
fa85150
1
Parent(s):
533bbc3
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,16 @@
|
|
1 |
from youtube_video import download_youtube_video
|
2 |
import requests
|
|
|
|
|
3 |
import gradio as gr
|
4 |
data = 'https://www.youtube.com/watch?v=ETDEuH3YL7I' #'https://www.youtube.com/watch?v=bJ5FDtgOwjo'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
def app(video_link):
|
6 |
video_path = download_youtube_video(video_link)
|
7 |
return video_path
|
@@ -12,7 +21,9 @@ interface = gr.Interface(
|
|
12 |
inputs=gr.Textbox(data, label="Enter YouTube link"),
|
13 |
outputs=gr.Video(label = "video_path")
|
14 |
)
|
15 |
-
gr.Interface.queue(api_open=True)
|
|
|
|
|
16 |
interface.launch(debug=True)
|
17 |
|
18 |
|
|
|
1 |
from youtube_video import download_youtube_video
|
2 |
import requests
|
3 |
+
from huggingface_hub import InferenceClient
|
4 |
+
|
5 |
import gradio as gr
|
6 |
data = 'https://www.youtube.com/watch?v=ETDEuH3YL7I' #'https://www.youtube.com/watch?v=bJ5FDtgOwjo'
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
client = InferenceClient(model="http://127.0.0.1:8080")
|
11 |
+
client.text_generation(prompt="Write a code for snake game")
|
12 |
+
|
13 |
+
|
14 |
def app(video_link):
|
15 |
video_path = download_youtube_video(video_link)
|
16 |
return video_path
|
|
|
21 |
inputs=gr.Textbox(data, label="Enter YouTube link"),
|
22 |
outputs=gr.Video(label = "video_path")
|
23 |
)
|
24 |
+
#gr.Interface.queue(api_open=True)
|
25 |
+
for token in client.text_generation("How do you make cheese?", max_new_tokens=12, stream=True):
|
26 |
+
print(token)
|
27 |
interface.launch(debug=True)
|
28 |
|
29 |
|