Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,13 +4,16 @@ from huggingface_hub import HfFolder
|
|
4 |
import requests
|
5 |
import asyncio
|
6 |
from gtts import gTTS
|
|
|
|
|
7 |
|
8 |
model_id = "sanchit-gandhi/whisper-small-dv" # update with your model id
|
9 |
pipe = pipeline("automatic-speech-recognition", model=model_id)
|
|
|
10 |
|
11 |
async def query(text, model_id="tiiuae/falcon-7b-instruct"):
|
12 |
api_url = f"https://api-inference.huggingface.co/models/{model_id}"
|
13 |
-
headers = {"Authorization": "Bearer
|
14 |
payload = {"inputs": text}
|
15 |
|
16 |
print(f"Querying...: {text}")
|
|
|
4 |
import requests
|
5 |
import asyncio
|
6 |
from gtts import gTTS
|
7 |
+
from dotenv import load_dotenv
|
8 |
+
import os
|
9 |
|
10 |
model_id = "sanchit-gandhi/whisper-small-dv" # update with your model id
|
11 |
pipe = pipeline("automatic-speech-recognition", model=model_id)
|
12 |
+
hugging_face_token=os.getenv("HUGGING_FACE_TOKEN")
|
13 |
|
14 |
async def query(text, model_id="tiiuae/falcon-7b-instruct"):
|
15 |
api_url = f"https://api-inference.huggingface.co/models/{model_id}"
|
16 |
+
headers = {"Authorization": f"Bearer {hugging_face_token}"}
|
17 |
payload = {"inputs": text}
|
18 |
|
19 |
print(f"Querying...: {text}")
|