Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,14 +45,6 @@ def get_llm_hf_inference(model_id=model_id, max_new_tokens=128, temperature=0.7)
|
|
45 |
task="text-generation"
|
46 |
)
|
47 |
|
48 |
-
def is_apod_query(user_text):
|
49 |
-
"""
|
50 |
-
Checks if the user's question contains keywords indicating they are asking for
|
51 |
-
the Astronomy Picture of the Day.
|
52 |
-
"""
|
53 |
-
keywords = ["apod", "image", "picture", "photo", "astronomy picture"]
|
54 |
-
return any(keyword in user_text.lower() for keyword in keywords)
|
55 |
-
|
56 |
def get_nasa_apod():
|
57 |
url = f"https://api.nasa.gov/planetary/apod?api_key={NASA_API_KEY}"
|
58 |
response = requests.get(url)
|
@@ -66,10 +58,13 @@ def analyze_sentiment(user_text):
|
|
66 |
result = sentiment_analyzer(user_text)[0]
|
67 |
return result['label']
|
68 |
|
69 |
-
def
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
73 |
|
74 |
def generate_follow_up(user_text):
|
75 |
"""
|
|
|
45 |
task="text-generation"
|
46 |
)
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
def get_nasa_apod():
|
49 |
url = f"https://api.nasa.gov/planetary/apod?api_key={NASA_API_KEY}"
|
50 |
response = requests.get(url)
|
|
|
58 |
result = sentiment_analyzer(user_text)[0]
|
59 |
return result['label']
|
60 |
|
61 |
+
def is_apod_query(user_text):
|
62 |
+
"""
|
63 |
+
Checks if the user's question contains keywords indicating they are asking for
|
64 |
+
the Astronomy Picture of the Day.
|
65 |
+
"""
|
66 |
+
keywords = ["apod", "image", "picture", "photo", "astronomy picture"]
|
67 |
+
return any(keyword in user_text.lower() for keyword in keywords)
|
68 |
|
69 |
def generate_follow_up(user_text):
|
70 |
"""
|