Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,13 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
| 3 |
-
from moviepy.editor import *
|
| 4 |
|
|
|
|
| 5 |
|
| 6 |
def Vid2Sum(vid_file):
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
#text = aud2text(audio_file)
|
| 12 |
-
#sum_text=Summarize(text["text"])
|
| 13 |
-
return ("Aloonnn")
|
| 14 |
-
print("Balloonn")
|
| 15 |
-
|
| 16 |
-
# return sum_text[0]["summary_text"]
|
| 17 |
|
| 18 |
iface = gr.Interface(fn=Vid2Sum, inputs="video", outputs="text")
|
| 19 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import requests
|
|
|
|
| 3 |
|
| 4 |
+
API_URL = "https://edensw-vid2sum.hf.space/run/predict"
|
| 5 |
|
| 6 |
def Vid2Sum(vid_file):
|
| 7 |
+
files = {"video": open(vid_file.name, "rb")}
|
| 8 |
+
response = requests.post(API_URL, files=files)
|
| 9 |
+
data = response.json()
|
| 10 |
+
return data["result"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
iface = gr.Interface(fn=Vid2Sum, inputs="video", outputs="text")
|
| 13 |
iface.launch()
|