svummidi commited on
Commit
ff2e27d
1 Parent(s): 882f683

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -7,16 +7,16 @@ import os
7
 
8
 
9
  cache = {}
10
- cache.put("RetroFeedback", GPTSimpleVectorIndex.load_from_disk('RetroFeedback.json'))
11
- cache.put("Snowflake", GPTSimpleVectorIndex.load_from_disk('Snowflake.json'))
12
- cache.put("Datadog", GPTSimpleVectorIndex.load_from_disk('Datadog.json'))
13
- cache.put("Databricks", GPTSimpleVectorIndex.load_from_disk('Databricks.json'))
14
 
15
  def chatbot(indexName, input_text):
16
  """
17
  Chatbot function that takes in a prompt and returns a response
18
  """
19
- index = cache.get(indexName)
20
  response = index.query(input_text, response_mode="compact")
21
  return response.response
22
 
 
7
 
8
 
9
  cache = {}
10
+ cache["RetroFeedback"]= GPTSimpleVectorIndex.load_from_disk('RetroFeedback.json'))
11
+ cache["Snowflake"]= GPTSimpleVectorIndex.load_from_disk('Snowflake.json'))
12
+ cache["Datadog"]= GPTSimpleVectorIndex.load_from_disk('Datadog.json'))
13
+ cache["Databricks"]= GPTSimpleVectorIndex.load_from_disk('Databricks.json'))
14
 
15
  def chatbot(indexName, input_text):
16
  """
17
  Chatbot function that takes in a prompt and returns a response
18
  """
19
+ index = cache[indexName]
20
  response = index.query(input_text, response_mode="compact")
21
  return response.response
22