alex-abb commited on
Commit
4ffc5f1
1 Parent(s): fb64d41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,9 +1,12 @@
1
  import gradio as gr
2
  import requests
 
3
 
4
  API_URL = "https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-8B-Instruct"
5
  headers = {"Authorization": "Bearer hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
6
 
 
 
7
  def analyze_sentiment(text):
8
  payload = {
9
  "inputs": f"Analyze the sentiment of the following text and respond with either 'heureux' or 'malheureux': {text}"
 
1
  import gradio as gr
2
  import requests
3
+ import spaces
4
 
5
  API_URL = "https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-8B-Instruct"
6
  headers = {"Authorization": "Bearer hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
7
 
8
+ @spaces.GPU
9
+
10
  def analyze_sentiment(text):
11
  payload = {
12
  "inputs": f"Analyze the sentiment of the following text and respond with either 'heureux' or 'malheureux': {text}"