Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
def chat_response(message):
|
2 |
if "syllabus" in message.lower():
|
3 |
-
|
|
|
|
|
|
|
4 |
response = chatbot(message, max_length=100, do_sample=True)
|
5 |
return response[0]['generated_text']
|
|
|
1 |
def chat_response(message):
|
2 |
if "syllabus" in message.lower():
|
3 |
+
chunk_size = 500 # Ek baar me 500 characters
|
4 |
+
chunks = [syllabus_text[i:i+chunk_size] for i in range(0, len(syllabus_text), chunk_size)]
|
5 |
+
return "\n\n".join(chunks[:3]) # Sirf pehle 3 chunks dikhayega (1500 characters)
|
6 |
+
|
7 |
response = chatbot(message, max_length=100, do_sample=True)
|
8 |
return response[0]['generated_text']
|