SoniR commited on
Commit
ba2bc03
·
1 Parent(s): 815fee8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -12
app.py CHANGED
@@ -1,18 +1,9 @@
1
  import streamlit as st
2
  from transformers import GPT2LMHeadModel, GPT2Tokenizer
3
 
4
- # # Load custom trained model and tokenizer
5
- # model = GPT2LMHeadModel.from_pretrained('https://huggingface.co/spaces/SoniR/chatbotllm/blob/main/config.json')
6
- # tokenizer = GPT2Tokenizer.from_pretrained('https://huggingface.co/spaces/SoniR/chatbotllm/blob/main/pytorch_model.bin')
7
-
8
- # Use a pipeline as a high-level helper
9
- from transformers import pipeline
10
-
11
- pipe = pipeline("text-generation", model="gpt2")# Load model directly
12
- from transformers import AutoTokenizer, AutoModelForCausalLM
13
-
14
- tokenizer = AutoTokenizer.from_pretrained("gpt2")
15
- model = AutoModelForCausalLM.from_pretrained("gpt2")
16
 
17
  # Streamlit app title
18
  st.title("Custom Trained Chatbot")
 
1
  import streamlit as st
2
  from transformers import GPT2LMHeadModel, GPT2Tokenizer
3
 
4
+ # Load custom trained model and tokenizer
5
+ model = GPT2LMHeadModel.from_pretrained('https://huggingface.co/spaces/SoniR/chatbotllm/blob/main/config.json')
6
+ tokenizer = GPT2Tokenizer.from_pretrained('https://huggingface.co/spaces/SoniR/chatbotllm/blob/main/pytorch_model.bin')
 
 
 
 
 
 
 
 
 
7
 
8
  # Streamlit app title
9
  st.title("Custom Trained Chatbot")