Spaces:
Runtime error
Runtime error
changed location of the article
Browse files
app.py
CHANGED
|
@@ -164,20 +164,25 @@ def query_movie_db(user_query):
|
|
| 164 |
|
| 165 |
# Create the Gradio interface
|
| 166 |
# Gradio provides a simple interface to interact with the model, allowing users to enter queries and receive responses.
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
description="Ask about movies and get detailed responses. Fore more details, visit my [blog post](https://www.kunal-pathak.com/blog/Movie-Recommendation-Bot/).", # Description of the interface
|
| 173 |
-
examples=[["Suggest me a scary movie?"], ["What action movie can I watch?"]], # Example queries
|
| 174 |
-
article="""
|
| 175 |
**My Movie Recommendation Bot** provides quick responses based on your queries but sometimes truncates replies due to token limitations in the free tier of Hugging Face resources.
|
| 176 |
|
| 177 |
This is not a coding issue but a result of operating within the token limitations of the free tier of Hugging Face resources.
|
| 178 |
|
| 179 |
To enhance response quality, better models and more resources could be used, but these come with higher costs, which I want to avoid as this is a hobby project.
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
)
|
| 182 |
|
| 183 |
# Launch the interface
|
|
|
|
| 164 |
|
| 165 |
# Create the Gradio interface
|
| 166 |
# Gradio provides a simple interface to interact with the model, allowing users to enter queries and receive responses.
|
| 167 |
+
import gradio as gr
|
| 168 |
+
|
| 169 |
+
description_and_article = """
|
| 170 |
+
Ask about movies and get detailed responses. For more details, checkout the code on [my github repo](https://github.com/kanad13/Movie-Recommendation-Bot).
|
| 171 |
+
|
|
|
|
|
|
|
|
|
|
| 172 |
**My Movie Recommendation Bot** provides quick responses based on your queries but sometimes truncates replies due to token limitations in the free tier of Hugging Face resources.
|
| 173 |
|
| 174 |
This is not a coding issue but a result of operating within the token limitations of the free tier of Hugging Face resources.
|
| 175 |
|
| 176 |
To enhance response quality, better models and more resources could be used, but these come with higher costs, which I want to avoid as this is a hobby project.
|
| 177 |
+
"""
|
| 178 |
+
|
| 179 |
+
iface = gr.Interface(
|
| 180 |
+
fn=query_movie_db, # Function to handle user queries
|
| 181 |
+
inputs=gr.Textbox(lines=2, placeholder="Enter your movie query here..."), # Textbox input for user queries
|
| 182 |
+
outputs="text", # Text output for responses
|
| 183 |
+
title="Movie Recommendation Bot", # Title of the interface
|
| 184 |
+
description=description_and_article, # Combined description and article content
|
| 185 |
+
examples=[["Suggest me a scary movie?"], ["What action movie can I watch?"]] # Example queries
|
| 186 |
)
|
| 187 |
|
| 188 |
# Launch the interface
|