dipesh1701 commited on
Commit
c3e5a3b
1 Parent(s): d0c1414

remove bigscience/bloom

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -2,25 +2,21 @@ import os
2
  import torch
3
  import gradio as gr
4
  import time
5
- from transformers import AutoTokenizer, AutoModel, pipeline
6
  from flores200_codes import flores_codes
7
 
8
 
9
  def load_models():
10
  # build model and tokenizer
11
  model_name_dict = {
12
- "bloom": "bigscience/bloom",
13
- #"nllb-distilled-600M": "facebook/nllb-200-distilled-600M",
14
- #'nllb-1.3B': 'facebook/nllb-200-1.3B',
15
- #'nllb-distilled-1.3B': 'facebook/nllb-200-distilled-1.3B',
16
- #'nllb-3.3B': 'facebook/nllb-200-3.3B',
17
  }
18
 
19
  model_dict = {}
20
 
21
  for call_name, real_name in model_name_dict.items():
22
  print("\tLoading model: %s" % call_name)
23
- model = AutoModel.from_pretrained(real_name)
24
  tokenizer = AutoTokenizer.from_pretrained(real_name)
25
  model_dict[call_name + "_model"] = model
26
  model_dict[call_name + "_tokenizer"] = tokenizer
@@ -69,7 +65,6 @@ if __name__ == "__main__":
69
 
70
  # define gradio demo
71
  lang_codes = list(flores_codes.keys())
72
- # inputs = [gr.inputs.Radio(['nllb-distilled-600M', 'nllb-1.3B', 'nllb-distilled-1.3B'], label='NLLB Model'),
73
  inputs = [
74
  gr.inputs.Dropdown(lang_codes, default="English", label="Source"),
75
  gr.inputs.Dropdown(lang_codes, default="Nepali", label="Target"),
 
2
  import torch
3
  import gradio as gr
4
  import time
5
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
6
  from flores200_codes import flores_codes
7
 
8
 
9
  def load_models():
10
  # build model and tokenizer
11
  model_name_dict = {
12
+ "nllb-distilled-600M": "facebook/nllb-200-distilled-600M",
 
 
 
 
13
  }
14
 
15
  model_dict = {}
16
 
17
  for call_name, real_name in model_name_dict.items():
18
  print("\tLoading model: %s" % call_name)
19
+ model = AutoModelForSeq2SeqLMl.from_pretrained(real_name)
20
  tokenizer = AutoTokenizer.from_pretrained(real_name)
21
  model_dict[call_name + "_model"] = model
22
  model_dict[call_name + "_tokenizer"] = tokenizer
 
65
 
66
  # define gradio demo
67
  lang_codes = list(flores_codes.keys())
 
68
  inputs = [
69
  gr.inputs.Dropdown(lang_codes, default="English", label="Source"),
70
  gr.inputs.Dropdown(lang_codes, default="Nepali", label="Target"),