Spaces:
Runtime error
Runtime error
Commit
·
8f6044c
1
Parent(s):
851c641
Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,12 @@ import torch
|
|
4 |
|
5 |
access_token = "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"
|
6 |
|
7 |
-
#set up the model
|
8 |
tokenizer = AutoTokenizer.from_pretrained("sunshineccl/Mental-health-chatbot" ,use_auth_token=access_token)
|
9 |
|
10 |
model = AutoModelForCausalLM.from_pretrained("sunshineccl/Mental-health-chatbot" ,use_auth_token=access_token)
|
11 |
-
#Defining a predict function
|
12 |
|
|
|
13 |
def predict(input, history=[]):
|
14 |
# tokenize the new input sentence
|
15 |
new_user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors='pt')
|
|
|
4 |
|
5 |
access_token = "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"
|
6 |
|
7 |
+
#set up the model
|
8 |
tokenizer = AutoTokenizer.from_pretrained("sunshineccl/Mental-health-chatbot" ,use_auth_token=access_token)
|
9 |
|
10 |
model = AutoModelForCausalLM.from_pretrained("sunshineccl/Mental-health-chatbot" ,use_auth_token=access_token)
|
|
|
11 |
|
12 |
+
#Defining a predict function
|
13 |
def predict(input, history=[]):
|
14 |
# tokenize the new input sentence
|
15 |
new_user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors='pt')
|