Krish-Upgrix commited on
Commit
2b4371b
·
verified ·
1 Parent(s): 2f7e3af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,7 +9,7 @@ API_TOKEN = os.getenv("HF_API_TOKEN")
9
  # Change MODEL_ID to a better model
10
  # MODEL_ID = "Salesforce/codet5p-770m" # CodeT5+ (Recommended)
11
  # MODEL_ID = "bigcode/starcoder2-15b" # StarCoder2
12
- MODEL_ID = "Salesforce/codet5p-770m" # Code Llama
13
  # MODEL_ID = "bigcode/starcoder"
14
  API_URL = f"https://api-inference.huggingface.co/models/{MODEL_ID}"
15
  HEADERS = {"Authorization": f"Bearer {API_TOKEN}"}
@@ -23,8 +23,8 @@ def translate_code(code_snippet, source_lang, target_lang):
23
  "parameters": {
24
  "max_new_tokens": 150,
25
  "temperature": 0.2,
26
- "top_k": 50
27
- # "stop": ["\n\n", "#", "//", "'''"]
28
  }
29
  })
30
 
 
9
  # Change MODEL_ID to a better model
10
  # MODEL_ID = "Salesforce/codet5p-770m" # CodeT5+ (Recommended)
11
  # MODEL_ID = "bigcode/starcoder2-15b" # StarCoder2
12
+ MODEL_ID = "Salesforce/CodeT5+" # Code Llama
13
  # MODEL_ID = "bigcode/starcoder"
14
  API_URL = f"https://api-inference.huggingface.co/models/{MODEL_ID}"
15
  HEADERS = {"Authorization": f"Bearer {API_TOKEN}"}
 
23
  "parameters": {
24
  "max_new_tokens": 150,
25
  "temperature": 0.2,
26
+ "top_k": 50,
27
+ "stop": ["\n\n", "#", "//", "'''"]
28
  }
29
  })
30