decodemai commited on
Commit
d4eba89
1 Parent(s): b8c615c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -23
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
- prompt="""
15
- 4 futuristic ideas for the intersection of
16
- Input: finance & blockchain
17
- Output:
18
- Decentralized stock trading platform: The use of blockchain technology to create a decentralized stock trading platform where users can buy and sell stocks without the need for a middleman. This could greatly reduce transaction costs and increase the security and transparency of the trading process.
19
- Cryptocurrency-based loans: The use of blockchain technology to create a decentralized lending platform where users can borrow and lend using cryptocurrencies. This could greatly reduce the costs and barriers of traditional lending and make it more accessible to a wider range of borrowers.
20
- Digital asset management: The use of blockchain technology to create a digital asset management platform where users can securely and transparently manage their digital assets such as cryptocurrencies, stocks, and other financial instruments.
21
- Smart contract-based insurance: The use of blockchain technology to create smart contract-based insurance policies that automatically execute payouts in the event of a claim. This could greatly reduce the need for human intervention and increase the speed and efficiency of the claims process.
22
- ###
23
- Input:ai & website
24
- Output:
25
- Personalized product recommendations: An AI-powered algorithm that analyzes customer browsing and purchase history to make personalized product recommendations on the website. This can help increase customer engagement and sales.
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,