smhavens commited on
Commit
9be73ed
1 Parent(s): 5503f0a

Fixing saving issues(PLEASE)

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -18,7 +18,7 @@ import subprocess
18
  import sys
19
 
20
  # !pip install https://huggingface.co/spacy/en_core_web_sm/resolve/main/en_core_web_sm-any-py3-none-any.whl
21
- subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'https://huggingface.co/spacy/en_core_web_sm/resolve/main/en_core_web_sm-any-py3-none-any.whl'])
22
  tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
23
  nltk.download('stopwords')
24
  nlp = spacy.load("en_core_web_sm")
@@ -164,12 +164,9 @@ def finetune(train_dataloader):
164
 
165
  model.fit(train_objectives=[(train_dataloader, train_loss)], epochs=10)
166
 
 
167
 
168
- model.save_to_hub(
169
- "all-MiniLM-agNews",
170
- organization="smhavens",
171
- train_datasets=["ag_news"],
172
- )
173
  # accuracy = compute_metrics(eval, metric)
174
 
175
  # training_args = TrainingArguments(output_dir="test_trainer", evaluation_strategy="epoch")
 
18
  import sys
19
 
20
  # !pip install https://huggingface.co/spacy/en_core_web_sm/resolve/main/en_core_web_sm-any-py3-none-any.whl
21
+ # subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'https://huggingface.co/spacy/en_core_web_sm/resolve/main/en_core_web_sm-any-py3-none-any.whl'])
22
  tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
23
  nltk.download('stopwords')
24
  nlp = spacy.load("en_core_web_sm")
 
164
 
165
  model.fit(train_objectives=[(train_dataloader, train_loss)], epochs=10)
166
 
167
+ model.save("ag_news_model")
168
 
169
+ model.save_to_hub("smhavens/all-MiniLM-agNews")
 
 
 
 
170
  # accuracy = compute_metrics(eval, metric)
171
 
172
  # training_args = TrainingArguments(output_dir="test_trainer", evaluation_strategy="epoch")