Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,29 +11,18 @@ API_TOKEN = os.getenv("API_TOKEN")
|
|
11 |
from huggingface_hub import InferenceApi
|
12 |
inference = InferenceApi("bigscience/bloom",token=API_TOKEN)
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
Chatbot customer service: An AI chatbot that can answer customer questions and provide assistance on the website. This can reduce the workload on customer service representatives and provide 24/7 assistance to customers.
|
27 |
-
Real-time language translation: An AI-powered tool that can automatically translate website content into multiple languages in real-time. This can help increase website accessibility and reach a global audience.
|
28 |
-
Smart search: An AI-powered search feature that can understand natural language queries and provide accurate and relevant results. This can improve the user experience and make it easier for customers to find the products they are looking for.
|
29 |
-
###
|
30 |
-
Input:car & bike
|
31 |
-
Output:
|
32 |
-
Smart bike lanes: In this scenario, car and bike traffic would be separated by smart bike lanes that use sensors and cameras to detect and alert drivers to the presence of bicycles. The smart bike lanes would also have the ability to change the speed limit for cars depending on the number of bicycles present, creating a safer and more efficient flow of traffic.
|
33 |
-
Autonomous bike-sharing: In this scenario, autonomous cars would be used to transport bicycles to designated bike-sharing stations. This would allow for a more efficient bike-sharing system, as the cars would be able to navigate to the closest available station and drop off the bicycles without the need for human intervention.
|
34 |
-
Intelligent traffic signals: In this scenario, traffic signals would be equipped with cameras and sensors that detect the presence of bicycles and adjust the timing of the lights accordingly. This would allow for a more efficient flow of traffic and reduce the risk of collisions between cars and bicycles.
|
35 |
-
Augmented reality bike navigation: In this scenario, cyclists would use augmented reality technology to navigate through the city. This would allow for a more intuitive and efficient navigation experience, as the cyclist would be able to see virtual signs and arrows overlaid on the real world, indicating the best route to take. Additionally, the technology would be able to alert the cyclist of potential hazards such as cars and other bicycles, making it safer for everyone.
|
36 |
-
###"""
|
37 |
|
38 |
def infer(prompt,
|
39 |
max_length = 250,
|
|
|
11 |
from huggingface_hub import InferenceApi
|
12 |
inference = InferenceApi("bigscience/bloom",token=API_TOKEN)
|
13 |
|
14 |
+
DECODEM_TOKEN=os.getenv("DECODEM_TOKEN")
|
15 |
+
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
|
16 |
+
url_decodemprompts='https://us-central1-createinsightsproject.cloudfunctions.net/getdecodemprompts'
|
17 |
+
|
18 |
+
data={"prompt_type":'intersection_scenarios',"decodem_token":DECODEM_TOKEN}
|
19 |
+
try:
|
20 |
+
r = requests.post(url_decodemprompts, data=json.dumps(data), headers=headers)
|
21 |
+
except requests.exceptions.ReadTimeout as e:
|
22 |
+
print(e)
|
23 |
+
#print(r.content)
|
24 |
+
|
25 |
+
prompt=str(r.content, 'UTF-8')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
def infer(prompt,
|
28 |
max_length = 250,
|