Spaces:
Sleeping
Sleeping
Download libs/query.py from AshwinUnnikrishnan/CineMatch2.0: direct link, hf CLI and curl.
- Browser
- Download file 493 Bytes
-
https://huggingface.co/spaces/AshwinUnnikrishnan/CineMatch2.0/resolve/main/libs/query.py
- Command line
-
hf download hf://spaces/AshwinUnnikrishnan/CineMatch2.0/libs/query.py
-
curl -L -o query.py https://huggingface.co/spaces/AshwinUnnikrishnan/CineMatch2.0/resolve/main/libs/query.py
493 Bytes
| """ | |
| Script contains the model loaded and respective functions with the model. | |
| """ | |
| import google.generativeai as genai | |
| from config.config import MODEL, GOOGLE_API_KEY | |
| model = genai.GenerativeModel(MODEL) | |
| genai.configure(api_key=GOOGLE_API_KEY) | |
| def get_answers(query): | |
| ''' | |
| Function to query the model and get the answers. | |
| :param query: a string containing search query. | |
| :return: response from the model | |
| ''' | |
| response = model.generate_content(query) | |
| return response | |