hertogateis commited on
Commit
6cc8274
·
verified ·
1 Parent(s): 7db7138

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,9 +1,13 @@
1
  import streamlit as st
2
  import transformers
3
  from transformers import T5Tokenizer, T5ForConditionalGeneration
4
- model_name = "t5-base"
5
- tokenizer = T5Tokenizer.from_pretrained(model_name)
6
- model = T5ForConditionalGeneration.from_pretrained(model_name)
 
 
 
 
7
  def generate_response(input_text):
8
  input_ids = tokenizer.encode(input_text, return_tensors='pt')
9
  outputs = model.generate(input_ids,
 
1
  import streamlit as st
2
  import transformers
3
  from transformers import T5Tokenizer, T5ForConditionalGeneration
4
+ #model_name = "t5-base"
5
+ #tokenizer = T5Tokenizer.from_pretrained(model_name)
6
+ #model = T5ForConditionalGeneration.from_pretrained(model_name)
7
+ model_name = "indonesia/gpt-2-small-indonesia"
8
+ model = GPT2LMHeadModel.from_pretrained(model_name)
9
+ tokenizer = GPT2Tokenizer.from_pretrained(model_name)
10
+
11
  def generate_response(input_text):
12
  input_ids = tokenizer.encode(input_text, return_tensors='pt')
13
  outputs = model.generate(input_ids,