mdkhalid commited on
Commit
734e4c8
·
1 Parent(s): 19e4ac6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -3,9 +3,10 @@ import gradio
3
 
4
  openai.api_key = "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"
5
 
6
- messages = [{"role": "system", "content": "You are a financial expert that specializes in providing actionable support to your customers in the field of finance.You always reply in English, German and Hindi Languages. You only talk about topics related to finance. The recommendation should be categorized in 3 categories. 1st is Young Adults under the age of 25, second is adults between 25 and 60 years and the third category is Senior citizen above 60 years."
 
 
7
  }]
8
-
9
  def CustomChatGPT(query):
10
  messages.append({"role": "user", "content": query})
11
  response = openai.ChatCompletion.create(
@@ -16,6 +17,6 @@ def CustomChatGPT(query):
16
  messages.append({"role": "assistant", "content": ChatGPT_reply})
17
  return ChatGPT_reply
18
 
19
- demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "Finance helper for Young and Old!")
20
 
21
  demo.launch()
 
3
 
4
  openai.api_key = "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"
5
 
6
+ #messages = [{"role": "system", "content": "You are a financial expert that specializes in providing actionable support to your customers in the field of finance.You always reply in English, German and Hindi Languages. You only talk about topics related to finance. The recommendation should be categorized in 3 categories. 1st is Young Adults under the age of 25, second is adults between 25 and 60 years and the third category is Senior citizen above 60 years."
7
+ #}]
8
+ messages = [{"role": "system", "content": "You are an expert in writing essays in English. You write professionally in a compelling tone."
9
  }]
 
10
  def CustomChatGPT(query):
11
  messages.append({"role": "user", "content": query})
12
  response = openai.ChatCompletion.create(
 
17
  messages.append({"role": "assistant", "content": ChatGPT_reply})
18
  return ChatGPT_reply
19
 
20
+ demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "Personal Chat bot powered by GPT 3.5 Turbo")
21
 
22
  demo.launch()