CCockrum commited on
Commit
69fe7cc
·
verified ·
1 Parent(s): 1c79b9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -12
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 predict_action(user_text):
70
- if "NASA" in user_text or "space" in user_text:
71
- return "nasa_info"
72
- return "general_query"
 
 
 
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
  """