Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import re
|
2 |
import os
|
3 |
-
from dotenv import load_dotenv
|
4 |
import json
|
5 |
import gradio as gr
|
6 |
import random
|
@@ -12,13 +12,14 @@ import tensorflow as tf
|
|
12 |
|
13 |
|
14 |
|
15 |
-
load_dotenv(override=True)
|
16 |
-
if not os.getenv("HF_API_KEY"):
|
17 |
-
raise ValueError("HF_API_KEY must be set")
|
18 |
-
hf_key = os.getenv('HF_API_KEY')
|
19 |
|
20 |
API_URL = "https://api-inference.huggingface.co/models/t4ai/distilbert-finetuned-t3-qa"
|
21 |
-
headers = {"Authorization": "Bearer " + hf_key }
|
|
|
22 |
|
23 |
def query_model(payload):
|
24 |
response = requests.post(API_URL, headers=headers, json=payload)
|
|
|
1 |
import re
|
2 |
import os
|
3 |
+
#from dotenv import load_dotenv
|
4 |
import json
|
5 |
import gradio as gr
|
6 |
import random
|
|
|
12 |
|
13 |
|
14 |
|
15 |
+
#load_dotenv(override=True)
|
16 |
+
#if not os.getenv("HF_API_KEY"):
|
17 |
+
# raise ValueError("HF_API_KEY must be set")
|
18 |
+
#hf_key = os.getenv('HF_API_KEY')
|
19 |
|
20 |
API_URL = "https://api-inference.huggingface.co/models/t4ai/distilbert-finetuned-t3-qa"
|
21 |
+
#headers = {"Authorization": "Bearer " + hf_key }
|
22 |
+
headers = {}
|
23 |
|
24 |
def query_model(payload):
|
25 |
response = requests.post(API_URL, headers=headers, json=payload)
|