decodemai commited on
Commit
8d9aa4b
·
1 Parent(s): 324a3e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -11,17 +11,19 @@ API_TOKEN = os.getenv("API_TOKEN")
11
  from huggingface_hub import InferenceApi
12
  inference = InferenceApi("bigscience/bloom",token=API_TOKEN)
13
 
14
- prompt ="""Play devil's advocate to this idea. Keep it crisp.
15
- Input:loan for SMEs
16
- Output:
17
- While loans for SMEs may seem like a great idea on paper, there are several potential downsides to consider. One major issue is the risk of default - small businesses are often more vulnerable to financial setbacks and may struggle to repay their loans. This could lead to a high rate of defaults, which could ultimately harm the lending institution and the economy as a whole. Additionally, there is always a risk of fraud or mismanagement of funds - small business owners may misuse the loan money for personal expenses or other non-business related activities. Finally, the process of applying for and securing a loan can be time-consuming and complex, which could discourage many small business owners from even attempting to get the funding they need.###
18
- Input:custom cake orders
19
- Output:
20
- One potential downside to custom cake orders is that they can be more expensive for customers, as bakers may charge a premium for creating a unique design or using specific ingredients. Additionally, there may be more room for error or disappointment if the customer's vision for the cake does not align with the baker's interpretation or execution. Additionally, custom cakes may take longer to prepare and may not be available for last-minute orders.###
21
- Input:ai for websites
22
- Output:
23
- While AI for websites may seem like a great idea, there are potential downsides to consider. One concern is the potential for privacy violations, as AI algorithms may collect and analyze personal data without users being fully aware. Additionally, AI may not always provide accurate or relevant information, leading to frustration for users. There is also the potential for AI to replace human customer service representatives, which could lead to job loss. Lastly, implementing AI technology can be costly and may not provide a significant enough return on investment for some businesses.
24
- ###"""
 
 
25
 
26
  def infer(prompt,
27
  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
+
16
+ headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
17
+ url_decodemprompts='https://us-central1-createinsightsproject.cloudfunctions.net/getdecodemprompts'
18
+
19
+ data={"prompt_type":'devils_advocate',"decodem_token":DECODEM_TOKEN}
20
+ try:
21
+ r = requests.post(url_decodemprompts, data=json.dumps(data), headers=headers)
22
+ except requests.exceptions.ReadTimeout as e:
23
+ print(e)
24
+ #print(r.content)
25
+
26
+ prompt=str(r.content, 'UTF-8')
27
 
28
  def infer(prompt,
29
  max_length = 250,