Spaces:
Running
Running
File size: 437 Bytes
7f8844d 088e658 7f8844d 91de782 |
1 2 3 4 5 6 7 8 9 |
def chat_response(message):
if "syllabus" in message.lower():
chunk_size = 500 # Ek baar me 500 characters
chunks = [syllabus_text[i:i+chunk_size] for i in range(0, len(syllabus_text), chunk_size)]
return "\n\n".join(chunks[:3]) # Sirf pehle 3 chunks dikhayega (1500 characters)
response = chatbot(message, max_length=100, do_sample=True)
return response[0]['generated_text']
iface.launch() |