Update app.py
Browse files
app.py
CHANGED
@@ -94,20 +94,19 @@ def audio_to_text():
|
|
94 |
|
95 |
def summarize():
|
96 |
transcript = audio_to_text()
|
97 |
-
|
98 |
-
|
99 |
-
chunks = int(len_trans/512)
|
100 |
-
from transformers import pipeline
|
101 |
-
|
102 |
-
summarizer = pipeline("summarization", model="Azma-AI/bart-large-text-summarizer")
|
103 |
-
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
final_output = ''
|
108 |
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
yt_link = st.text_input("Enter the YouTube URL: ")
|
113 |
|
|
|
94 |
|
95 |
def summarize():
|
96 |
transcript = audio_to_text()
|
97 |
+
import requests
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
+
API_URL = "https://api-inference.huggingface.co/models/Azma-AI/bart-large-text-summarizer"
|
100 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
|
|
101 |
|
102 |
+
def query(payload):
|
103 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
104 |
+
return response.json()
|
105 |
+
|
106 |
+
output = query({
|
107 |
+
"inputs": transcript["text"],
|
108 |
+
})
|
109 |
+
return output
|
110 |
|
111 |
yt_link = st.text_input("Enter the YouTube URL: ")
|
112 |
|