JeCabrera commited on
Commit
7360ca9
·
verified ·
1 Parent(s): 71a12c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -13
app.py CHANGED
@@ -78,20 +78,9 @@ IMPORTANT RULES:
78
  6. Always check the provided PDF document for detailed course information before answering questions. Use this information to provide accurate and complete responses about the course content, benefits, prices and features.
79
  """
80
 
81
- def chat(message, history):
82
- try:
83
- messages = [
84
- {"role": "user", "parts": [system_prompt]},
85
- *[{"role": "user", "parts": [msg[0]]} for msg in history],
86
- {"role": "user", "parts": [message]}
87
- ]
88
- response = model.generate_content(messages)
89
- return response.text
90
- except Exception as e:
91
- return f"Error: {e}"
92
-
93
  demo = gr.ChatInterface(
94
- fn=chat,
95
  examples=[
96
  "¿Qué incluye el curso CopyXpert?",
97
  "¿Cuál es el precio del curso?",
 
78
  6. Always check the provided PDF document for detailed course information before answering questions. Use this information to provide accurate and complete responses about the course content, benefits, prices and features.
79
  """
80
 
81
+ # Keep only this demo configuration
 
 
 
 
 
 
 
 
 
 
 
82
  demo = gr.ChatInterface(
83
+ fn=chat, # This now uses the PDF-aware chat function
84
  examples=[
85
  "¿Qué incluye el curso CopyXpert?",
86
  "¿Cuál es el precio del curso?",