Update app.py
Browse files
app.py
CHANGED
|
@@ -9,11 +9,11 @@ model = pipeline(model='google/flan-t5-base')
|
|
| 9 |
def chatbot(input_text):
|
| 10 |
|
| 11 |
prompt = f"Give the answer of the given input in context from the bhagwat geeta. give suggestions to user which are based upon the meanings of shlok in bhagwat geeta, input = {input_text}"
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
# Define the Gradio interface
|
| 19 |
gradio_interface = gradio.Interface(
|
|
|
|
| 9 |
def chatbot(input_text):
|
| 10 |
|
| 11 |
prompt = f"Give the answer of the given input in context from the bhagwat geeta. give suggestions to user which are based upon the meanings of shlok in bhagwat geeta, input = {input_text}"
|
| 12 |
+
# Generate a response from the Hugging Face model
|
| 13 |
+
response = model(prompt, max_length=250, do_sample=True)[0]['generated_text'].strip()
|
| 14 |
|
| 15 |
+
# Return the bot response
|
| 16 |
+
return response
|
| 17 |
|
| 18 |
# Define the Gradio interface
|
| 19 |
gradio_interface = gradio.Interface(
|