Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,8 @@ import datetime
|
|
8 |
from datetime import datetime
|
9 |
|
10 |
API_TOKEN = os.getenv("API_TOKEN")
|
|
|
|
|
11 |
from huggingface_hub import InferenceApi
|
12 |
inference = InferenceApi("bigscience/bloom",token=API_TOKEN)
|
13 |
|
@@ -36,6 +38,16 @@ Home delivery robots: Use autonomous delivery robots to deliver biscuits directl
|
|
36 |
###
|
37 |
"""
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
def infer(prompt,
|
40 |
max_length = 250,
|
41 |
top_k = 0,
|
|
|
8 |
from datetime import datetime
|
9 |
|
10 |
API_TOKEN = os.getenv("API_TOKEN")
|
11 |
+
DECODEM_TOKEN=os.getenv("DECODEM_TOKEN")
|
12 |
+
|
13 |
from huggingface_hub import InferenceApi
|
14 |
inference = InferenceApi("bigscience/bloom",token=API_TOKEN)
|
15 |
|
|
|
38 |
###
|
39 |
"""
|
40 |
|
41 |
+
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
|
42 |
+
url_decodemprompts='https://us-central1-createinsightsproject.cloudfunctions.net/getdecodemprompts'
|
43 |
+
|
44 |
+
data={"prompt_type":'business_tech_ideas',"decodem_token":DECODEM_TOKEN}
|
45 |
+
try:
|
46 |
+
r = requests.post(url_decodemprompts, data=json.dumps(data), headers=headers)
|
47 |
+
except requests.exceptions.ReadTimeout as e:
|
48 |
+
print(e)
|
49 |
+
prompt=r
|
50 |
+
|
51 |
def infer(prompt,
|
52 |
max_length = 250,
|
53 |
top_k = 0,
|