Spaces:
Sleeping
Sleeping
Update langchain_movie_search.py
Browse files
langchain_movie_search.py
CHANGED
|
@@ -61,6 +61,9 @@ class MoviesSearch:
|
|
| 61 |
:param query: A user query to search
|
| 62 |
:return: String answer generated by the LLM
|
| 63 |
"""
|
|
|
|
|
|
|
|
|
|
| 64 |
hf_llm: HuggingFaceEndpoint = HuggingFaceEndpoint(
|
| 65 |
repo_id=self.huggingface_text_generation_model,
|
| 66 |
huggingfacehub_api_token=self.huggingface_api_token,
|
|
|
|
| 61 |
:param query: A user query to search
|
| 62 |
:return: String answer generated by the LLM
|
| 63 |
"""
|
| 64 |
+
if len(query) == 0:
|
| 65 |
+
raise gr.Error("Enter a prompt to generate a response !", duration=5)
|
| 66 |
+
|
| 67 |
hf_llm: HuggingFaceEndpoint = HuggingFaceEndpoint(
|
| 68 |
repo_id=self.huggingface_text_generation_model,
|
| 69 |
huggingfacehub_api_token=self.huggingface_api_token,
|