jeydipak commited on
Commit
dfcdd52
1 Parent(s): a792d0c

added weights

Browse files
Files changed (1) hide show
  1. pages/task3.py +4 -5
pages/task3.py CHANGED
@@ -29,12 +29,11 @@ button_style = """
29
 
30
  DEVICE = 'cpu'
31
 
32
- # Загрузка пользовательской модели и токенизатора (замените на свои пути и модель)
33
- # model_path = "sberbank-ai/rugpt3small_based_on_gpt2"
34
- # tokenizer_path = "sberbank-ai/rugpt3small_based_on_gpt2"
35
 
36
- # model = GPT2LMHeadModel.from_pretrained(model_path).to(DEVICE)
37
- # tokenizer = GPT2Tokenizer.from_pretrained(tokenizer_path)
 
 
38
 
39
  st.markdown("""
40
  <style>
 
29
 
30
  DEVICE = 'cpu'
31
 
 
 
 
32
 
33
+ tokenizer_path = "sberbank-ai/rugpt3small_based_on_gpt2"
34
+
35
+ model = torch.load('srcs/gpt_weights.pth').to(DEVICE)
36
+ tokenizer = GPT2Tokenizer.from_pretrained(tokenizer_path)
37
 
38
  st.markdown("""
39
  <style>