eliasangels commited on
Commit
559482e
·
verified ·
1 Parent(s): f395c2a

fixing nesting errors

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -43,29 +43,29 @@ def respond(message, history):
43
  if history:
44
  messages.extend(history)
45
 
46
- # topResults = getTopChunks(message, chunkEmbeddings, cleanedChunks)
47
- # context = "\n\n".join(topResults)
48
 
49
- # messages.append({"role": "system",
50
- # "content": context})
51
 
52
- messages.append({"role": "user",
53
  "content": message})
54
 
55
- response = ""
56
 
57
- responseStream = client.chat_completion(
58
- messages, stream = True, max_tokens = 1024, temperature = 0.4
59
- )
60
 
61
- for segment in responseStream:
62
- token = segment.choices[0].delta.content
63
- if token is not None:
64
- response += token
65
- yield response
66
 
67
  chatbot = gr.ChatInterface(respond, title = "Student Formula Bot 🔬",
68
- description = "Welcome to the core component of our project, The Student Formula: the RAG chatbot! With the ability to act as a finance tutor, accountability buddy, and goal-setting partner all in one, it's designed to best suit your needs on the way to productivity and success.")
69
 
70
  chatbot.launch()
71
 
 
43
  if history:
44
  messages.extend(history)
45
 
46
+ # topResults = getTopChunks(message, chunkEmbeddings, cleanedChunks)
47
+ # context = "\n\n".join(topResults)
48
 
49
+ # messages.append({"role": "system",
50
+ # "content": context})
51
 
52
+ messages.append({"role": "user",
53
  "content": message})
54
 
55
+ response = ""
56
 
57
+ responseStream = client.chat_completion(
58
+ messages, stream = True, max_tokens = 1024, temperature = 0.4
59
+ )
60
 
61
+ for segment in responseStream:
62
+ token = segment.choices[0].delta.content
63
+ if token is not None:
64
+ response += token
65
+ yield response
66
 
67
  chatbot = gr.ChatInterface(respond, title = "Student Formula Bot 🔬",
68
+ description = "Welcome to the core component of "The Student Formula": the RAG chatbot! With the ability to act as a finance tutor, accountability buddy, and goal-setting partner all in one, it's designed to best suit your needs on the way to productivity and success. To get started, ask about the basic principles of creating a budget!")
69
 
70
  chatbot.launch()
71