abigaildavis commited on
Commit
db906a2
·
verified ·
1 Parent(s): 6faa541

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -18
app.py CHANGED
@@ -73,13 +73,13 @@ def generate_response(user_query, relevant_segment):
73
  messages.append({"role": "user", "content": user_message})
74
 
75
  response = openai.ChatCompletion.create(
76
- model="gpt-3.5-turbo",
77
  messages=messages,
78
- max_tokens=150,
79
- temperature=0.2,
80
  top_p=1,
81
- frequency_penalty=0,
82
- presence_penalty=0
83
  )
84
 
85
  # Extract the response text
@@ -108,20 +108,16 @@ def query_model(question):
108
 
109
  # Define the welcome message and specific topics the chatbot can provide information about
110
  welcome_message = """
111
- # ♟️ Welcome to ChessBot!
112
-
113
- ## Your AI-driven assistant for all chess-related queries. Created by Abigail, Reet, and Sora of the 2024 Kode With Klossy CITY Camp.
114
  """
115
 
116
  topics = """
117
- ### Feel Free to ask me anything from the topics below!
118
- - Chess piece movements
119
- - Special moves
120
- - Game phases
121
- - Common strategies
122
- - Chess terminology
123
- - Famous games
124
- - Chess tactics
125
  """
126
 
127
  # Setup the Gradio Blocks interface with custom layout components
@@ -133,10 +129,10 @@ with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
133
  with gr.Row():
134
  with gr.Column():
135
  question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
136
- answer = gr.Textbox(label="ChessBot Response", placeholder="ChessBot will respond here...", interactive=False, lines=10)
137
  submit_button = gr.Button("Submit")
138
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
139
 
140
 
141
  # Launch the Gradio app to allow user interaction
142
- demo.launch(share=True)
 
73
  messages.append({"role": "user", "content": user_message})
74
 
75
  response = openai.ChatCompletion.create(
76
+ model="gpt-4o",
77
  messages=messages,
78
+ max_tokens=200,
79
+ temperature=0.5,
80
  top_p=1,
81
+ frequency_penalty=0.5,
82
+ presence_penalty=0.5
83
  )
84
 
85
  # Extract the response text
 
108
 
109
  # Define the welcome message and specific topics the chatbot can provide information about
110
  welcome_message = """
111
+ # ♟️ Welcome to Collete!
112
+ ## Your AI-driven assistant for all college-related queries. Created by Abigail, Reet, and Sora of the 2024 Kode With Klossy DC Camp.
 
113
  """
114
 
115
  topics = """
116
+ ###
117
+ Please start by entering your college preferences and information in this format: {state-of-residence}, {out/in state}, {max-tuition-in-thousands}, {gender-diversity-rating}, {ethnic-diversity-rating}, {urban/rural}
118
+ The diversity ratings are on a scale of 1-10 for importance to the user
119
+
120
+ Example: Virginia, in-state, 50, 8, 5, rural
 
 
 
121
  """
122
 
123
  # Setup the Gradio Blocks interface with custom layout components
 
129
  with gr.Row():
130
  with gr.Column():
131
  question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
132
+ answer = gr.Textbox(label="Collete's Response", placeholder="Collete will respond here...", interactive=False, lines=10)
133
  submit_button = gr.Button("Submit")
134
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
135
 
136
 
137
  # Launch the Gradio app to allow user interaction
138
+ demo.launch(share=True)