wtarit commited on
Commit
1fd4283
·
unverified ·
1 Parent(s): fd80f4e

Update to new torch, transformer, gradio version

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +1 -1
  3. requirements.txt +2 -2
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🚀
4
  colorFrom: pink
5
  colorTo: blue
6
  sdk: gradio
7
- sdk_version: 4.43.0
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
4
  colorFrom: pink
5
  colorTo: blue
6
  sdk: gradio
7
+ sdk_version: 5.9.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
app.py CHANGED
@@ -9,7 +9,7 @@ tokenizer = NllbTokenizerFast.from_pretrained(model_repo, src_lang="tha_Thai", t
9
  def translate(Text):
10
  inputs = tokenizer(Text, return_tensors="pt")
11
  translated_tokens = model.generate(
12
- **inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=64
13
  )
14
  return tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0]
15
 
 
9
  def translate(Text):
10
  inputs = tokenizer(Text, return_tensors="pt")
11
  translated_tokens = model.generate(
12
+ **inputs, forced_bos_token_id=tokenizer.convert_tokens_to_ids("eng_Latn"), max_length=64
13
  )
14
  return tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)[0]
15
 
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- torch
2
- transformers
 
1
+ torch==2.5
2
+ transformers==4.47