ryanrwatkins commited on
Commit
8de6323
·
1 Parent(s): 219de1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -61,6 +61,21 @@ def submit_message(prompt, prompt_template, temperature, max_tokens, context_len
61
  try:
62
  completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=system_prompt + history[-context_length*2:] + [prompt_msg], temperature=temperature, max_tokens=max_tokens)
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  history.append(prompt_msg)
65
  history.append(completion.choices[0].message.to_dict())
66
 
@@ -102,7 +117,7 @@ with gr.Blocks(css=css) as demo:
102
  ## Ask questions of experts on needs assessments, get responses from *needs assessment* version of ChatGPT.
103
  Ask questions of all of them, or pick your guru.""",
104
  elem_id="header")
105
-
106
  with gr.Row():
107
  with gr.Column():
108
  chatbot = gr.Chatbot(elem_id="chatbox")
 
61
  try:
62
  completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=system_prompt + history[-context_length*2:] + [prompt_msg], temperature=temperature, max_tokens=max_tokens)
63
 
64
+ # completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=system_prompt + history[-context_length*2:] + [prompt_msg], temperature=temperature, max_tokens=max_tokens)
65
+
66
+ # vectordb = "/embeddings/"
67
+
68
+ path = "/embeddings"
69
+ dirs = os.listdir( path )
70
+
71
+ for file in dirs:
72
+ file
73
+
74
+ # completion = ChatVectorDBChain.from_llm(OpenAI(temperature=0, model_name="gpt-3.5-turbo"), vectordb, return_source_documents=True)
75
+ # query = "Have Romeo and Juliet spent the night together? Provide a verbose answer, referencing passages from the book."
76
+ # result = completion({"question": query, "chat_history": chat_history})
77
+ # from https://blog.devgenius.io/chat-with-document-s-using-openai-chatgpt-api-and-text-embedding-6a0ce3dc8bc8
78
+
79
  history.append(prompt_msg)
80
  history.append(completion.choices[0].message.to_dict())
81
 
 
117
  ## Ask questions of experts on needs assessments, get responses from *needs assessment* version of ChatGPT.
118
  Ask questions of all of them, or pick your guru.""",
119
  elem_id="header")
120
+ gr.Markdown(file)
121
  with gr.Row():
122
  with gr.Column():
123
  chatbot = gr.Chatbot(elem_id="chatbox")