fastx commited on
Commit
6a31562
·
1 Parent(s): e5da904

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -5,7 +5,7 @@ import sys
5
  import os
6
  from IPython.display import Markdown, display
7
 
8
- def construct_index(directory_path):
9
  max_input_size = 4096
10
  num_outputs = 2000
11
  max_chunk_overlap = 20
@@ -35,11 +35,11 @@ def ask_ai(question):
35
  response = index.query(question, response_mode="compact")
36
  return response.response
37
 
 
38
  os.environ["OPENAI_API_KEY"] = "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"
39
 
40
 
41
- construct_index("data")
42
-
43
- iface = gr.Interface(fn=ask_ai, inputs="text", outputs="text" ,title="Chatbot")
44
 
 
45
  iface.launch()
 
5
  import os
6
  from IPython.display import Markdown, display
7
 
8
+ def train_with_data(directory_path):
9
  max_input_size = 4096
10
  num_outputs = 2000
11
  max_chunk_overlap = 20
 
35
  response = index.query(question, response_mode="compact")
36
  return response.response
37
 
38
+ #input your api key
39
  os.environ["OPENAI_API_KEY"] = "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"
40
 
41
 
42
+ train_with_data("data")
 
 
43
 
44
+ iface = gr.Interface(fn=ask_ai, inputs="text", outputs="text" ,title="Jim's Chatbot")
45
  iface.launch()