Dannyar608 commited on
Commit
3af8029
·
verified ·
1 Parent(s): 444c474

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -1837,8 +1837,17 @@ def create_interface():
1837
  gr.Markdown("## Your Personalized Learning Assistant")
1838
  gr.Markdown("Ask me anything about studying, your courses, grades, or learning strategies.")
1839
 
 
 
 
 
 
 
 
 
 
1840
  chatbot = gr.ChatInterface(
1841
- fn=lambda msg, hist: teaching_assistant.generate_response(msg, hist, session_token.value),
1842
  examples=[
1843
  "How should I study for my next math test?",
1844
  "What's my current GPA?",
 
1837
  gr.Markdown("## Your Personalized Learning Assistant")
1838
  gr.Markdown("Ask me anything about studying, your courses, grades, or learning strategies.")
1839
 
1840
+ # Create a wrapper function that properly awaits the async function
1841
+ async def chat_wrapper(message: str, history: List[List[str]]):
1842
+ response = await teaching_assistant.generate_response(
1843
+ message,
1844
+ history,
1845
+ session_token.value
1846
+ )
1847
+ return response
1848
+
1849
  chatbot = gr.ChatInterface(
1850
+ fn=chat_wrapper,
1851
  examples=[
1852
  "How should I study for my next math test?",
1853
  "What's my current GPA?",