curl -X 'POST' \
  'http://127.0.0.1:8000/analyze_emotion/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "video_id": "KmFBJjLf8zs"
}
'
INFO:     127.0.0.1:49985 - "POST /analyze_emotion/ HTTP/1.1" 500 Internal Server Error
INFO:     127.0.0.1:49987 - "POST /analyze_emotion/ HTTP/1.1" 500 Internal Server Error
^CINFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [8843]
INFO:     Stopping reloader process [8841]
(sentiment_env) annamag@Annas-MacBook-Air youtube-comment-analysis % nano app.py
(sentiment_env) annamag@Annas-MacBook-Air youtube-comment-analysis % uvicorn app:app --reload

INFO:     Will watch for changes in these directories: ['/Users/annamag/youtube-comment-analysis']
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [9548] using StatReload
INFO:app:Loading model: meta-llama/Llama-2-7b-hf
Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████| 2/2 [02:54<00:00, 87.34s/it]
INFO:     Started server process [9550]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     127.0.0.1:49992 - "GET /docs HTTP/1.1" 200 OK
INFO:     127.0.0.1:49992 - "GET /openapi.json HTTP/1.1" 200 OK
INFO:     127.0.0.1:49993 - "GET /docs HTTP/1.1" 200 OK
INFO:     127.0.0.1:49993 - "GET /openapi.json HTTP/1.1" 200 OK
INFO:googleapiclient.discovery_cache:file_cache is only supported with oauth2client<4.0.0
ERROR:app:Error fetching comments: <HttpError 400 when requesting https://youtube.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId=KmFBJjLf8zs&textFormat=plainText&maxResults=100&key=YOUR_YOUTUBE_API_KEY&alt=json returned "API key not valid. Please pass a valid API key.". Details: "[{'message': 'API key not valid. Please pass a valid API key.', 'domain': 'global', 'reason': 'badRequest'}]">
INFO:     127.0.0.1:49994 - "POST /analyze_emotion/ HTTP/1.1" 404 Not Found
INFO:googleapiclient.discovery_cache:file_cache is only supported with oauth2client<4.0.0
ERROR:app:Error fetching comments: <HttpError 400 when requesting https://youtube.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId=KmFBJjLf8zs&textFormat=plainText&maxResults=100&key=YOUR_YOUTUBE_API_KEY&alt=json returned "API key not valid. Please pass a valid API key.". Details: "[{'message': 'API key not valid. Please pass a valid API key.', 'domain': 'global', 'reason': 'badRequest'}]">
INFO:     127.0.0.1:49994 - "POST /analyze_emotion/ HTTP/1.1" 404 Not Found
^CINFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [9550]
INFO:     Stopping reloader process [9548]
/usr/local/Cellar/python@3.12/3.12.7/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
(sentiment_env) annamag@Annas-MacBook-Air youtube-comment-analysis % nano app.py
(sentiment_env) annamag@Annas-MacBook-Air youtube-comment-analysis % uvicorn app:app --reload
INFO:     Will watch for changes in these directories: ['/Users/annamag/youtube-comment-analysis']
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [9852] using StatReload
INFO:app:Loading model: meta-llama/Llama-2-7b-hf
Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████| 2/2 [03:03<00:00, 91.65s/it]
INFO:     Started server process [9854]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     127.0.0.1:50000 - "GET /docs HTTP/1.1" 200 OK
INFO:     127.0.0.1:50000 - "GET /openapi.json HTTP/1.1" 200 OK
INFO:     127.0.0.1:50001 - "GET /docs HTTP/1.1" 200 OK
INFO:     127.0.0.1:50001 - "GET /openapi.json HTTP/1.1" 200 OK
INFO:app:Received request to analyze video_id: KmFBJjLf8zs
INFO:googleapiclient.discovery_cache:file_cache is only supported with oauth2client<4.0.0
INFO:app:Analyzing emotions for text: Link To Rumble Podcast: https://rumble.com/v5goi31-david-icke-unmasks-the-global-elite-reset-agenda-trump-vs-kamala-2024-natur.html
INFO:app:Retrieving context for query: Link To Rumble Podcast: https://rumble.com/v5goi31-david-icke-unmasks-the-global-elite-reset-agenda-trump-vs-kamala-2024-natur.html
WARNING:app:Knowledge base is None, returning empty context.
INFO:app:Generated prompt: Context: 
Text: Link To Rumble Podcast: https://rumble.com/v5goi31-david-icke-unmasks-the-global-elite-reset-agenda-trump-vs-kamala-2024-natur.html
Emotion:
Starting from v4.46, the `logits` model output will have the same type as the model (except at train time, where it will always be FP32)
^C
^C
^C
^C

  [Restored Oct 11, 2024 at 9:19:47 PM]
Last login: Fri Oct 11 21:19:36 on console

Im not sure why it doesn't work