Piux24 commited on
Commit
7f8844d
·
verified ·
1 Parent(s): 982dac3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -1,6 +1,5 @@
1
- try:
2
- syllabus_text = read_pdf("syllabus.pdf")
3
- print("Syllabus Loaded Successfully!")
4
- except Exception as e:
5
- syllabus_text = "Syllabus could not be loaded."
6
- print(f"Error: {e}")
 
1
+ def chat_response(message):
2
+ if "syllabus" in message.lower():
3
+ return syllabus_text[:1000] # Syllabus ka first 1000 characters return karega
4
+ response = chatbot(message, max_length=100, do_sample=True)
5
+ return response[0]['generated_text']