kenton-li commited on
Commit
464066d
·
1 Parent(s): 470fb17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -4,8 +4,6 @@ import time
4
  import openai
5
  import pandas as pd
6
 
7
- openai.api_key = ""
8
-
9
 
10
  openai_api_key_textbox = ""
11
  model = None
@@ -13,11 +11,11 @@ tokenizer = None
13
  generator = None
14
  csv_name = "disease_database_mini.csv"
15
  df = pd.read_csv(csv_name)
16
-
17
 
18
  def csv_prompter(question,csv_name):
19
 
20
- openai.api_key = openai_api_key_textbox
21
 
22
  fulltext = "A question is provided below. Given the question, extract " + \
23
  "keywords from the text. Focus on extracting the keywords that we can use " + \
@@ -119,10 +117,7 @@ def csv_prompter(question,csv_name):
119
  with gr.Blocks() as demo:
120
  gr.Markdown("# Autonomous ChatDoctor (openai version), based on disease database knowledge")
121
  gr.Markdown("## Example: If I have frontal headache, fever, and painful sinuses, what disease should I have, and what medical test should I take?")
122
- openai_api_key_textbox = gr.Textbox(placeholder="Paste your OpenAI API key (sk-...) and hit Enter",
123
- show_label=False, lines=1, type='password')
124
- print(openai_api_key_textbox)
125
-
126
  chatbot = gr.Chatbot()
127
  msg = gr.Textbox()
128
  clear = gr.Button("Clear")
 
4
  import openai
5
  import pandas as pd
6
 
 
 
7
 
8
  openai_api_key_textbox = ""
9
  model = None
 
11
  generator = None
12
  csv_name = "disease_database_mini.csv"
13
  df = pd.read_csv(csv_name)
14
+ openai.api_key = "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"
15
 
16
  def csv_prompter(question,csv_name):
17
 
18
+
19
 
20
  fulltext = "A question is provided below. Given the question, extract " + \
21
  "keywords from the text. Focus on extracting the keywords that we can use " + \
 
117
  with gr.Blocks() as demo:
118
  gr.Markdown("# Autonomous ChatDoctor (openai version), based on disease database knowledge")
119
  gr.Markdown("## Example: If I have frontal headache, fever, and painful sinuses, what disease should I have, and what medical test should I take?")
120
+
 
 
 
121
  chatbot = gr.Chatbot()
122
  msg = gr.Textbox()
123
  clear = gr.Button("Clear")