andyski commited on
Commit
a7e6d8c
·
verified ·
1 Parent(s): 55cf875

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,10 +3,11 @@ import gradio, requests
3
 
4
  #DEFINE MODEL TRHU PIPELINE
5
  pipeline = pipeline(task="translation", model="Helsinki-NLP/opus-mt-zh-en")
 
6
 
7
  #MAKING THE FUNCION
8
  def generate_translation(text_req, parameters=None,API_URL="https://api-inference.huggingface.co/models/Helsinki-NLP/opus-mt-zh-en"):
9
- http_header = {"Authorization": f"Bearer {dlaitoken}"}
10
  data_input = {"inputs": text_req, "parameters": parameters}
11
 
12
  http_response_handler = requests.request("POST", API_URL, headers=http_header, data=data_input)
 
3
 
4
  #DEFINE MODEL TRHU PIPELINE
5
  pipeline = pipeline(task="translation", model="Helsinki-NLP/opus-mt-zh-en")
6
+ {dla}
7
 
8
  #MAKING THE FUNCION
9
  def generate_translation(text_req, parameters=None,API_URL="https://api-inference.huggingface.co/models/Helsinki-NLP/opus-mt-zh-en"):
10
+ http_header = {"Authorization": f"Bearer {$dlaitoken}"}
11
  data_input = {"inputs": text_req, "parameters": parameters}
12
 
13
  http_response_handler = requests.request("POST", API_URL, headers=http_header, data=data_input)