ChihChiu29 commited on
Commit
00b72fa
1 Parent(s): 60e4f79

change model to google t5

Browse files
Files changed (2) hide show
  1. main.py +6 -4
  2. tutorial.md +7 -1
main.py CHANGED
@@ -12,11 +12,13 @@ from transformers import T5Tokenizer, T5ForConditionalGeneration
12
  # FROM: https://huggingface.co/facebook/blenderbot-400M-distill?text=Hey+my+name+is+Thomas%21+How+are+you%3F
13
  # tokenizer = AutoTokenizer.from_pretrained("facebook/blenderbot-400M-distill")
14
  # model = AutoModelForSeq2SeqLM.from_pretrained("facebook/blenderbot-400M-distill")
15
- tokenizer = AutoTokenizer.from_pretrained("facebook/blenderbot-1B-distill")
16
- model = AutoModelForSeq2SeqLM.from_pretrained("facebook/blenderbot-1B-distill")
17
  # tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small")
18
- # model = T5ForConditionalGeneration.from_pretrained(
19
- # "google/flan-t5-small", device_map="auto")
 
 
20
 
21
  token_size_limit = 128
22
 
 
12
  # FROM: https://huggingface.co/facebook/blenderbot-400M-distill?text=Hey+my+name+is+Thomas%21+How+are+you%3F
13
  # tokenizer = AutoTokenizer.from_pretrained("facebook/blenderbot-400M-distill")
14
  # model = AutoModelForSeq2SeqLM.from_pretrained("facebook/blenderbot-400M-distill")
15
+ # tokenizer = AutoTokenizer.from_pretrained("facebook/blenderbot-1B-distill")
16
+ # model = AutoModelForSeq2SeqLM.from_pretrained("facebook/blenderbot-1B-distill")
17
  # tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small")
18
+ # model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small")
19
+ tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-xxl")
20
+ model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-xxl")
21
+
22
 
23
  token_size_limit = 128
24
 
tutorial.md CHANGED
@@ -13,4 +13,10 @@ docker run -it -p 7860:7860 fastapi
13
 
14
  ```bash
15
  curl -X POST http://localhost:7860/reply -H 'Content-Type: application/json' -d '{"msg": "hi"}'
16
- ```
 
 
 
 
 
 
 
13
 
14
  ```bash
15
  curl -X POST http://localhost:7860/reply -H 'Content-Type: application/json' -d '{"msg": "hi"}'
16
+ ```
17
+
18
+ ### Huggingface API
19
+
20
+ See: https://huggingface.co/docs/hub/api
21
+
22
+ Access info for a space: https://huggingface.co/api/spaces/ChihChiu29/mychatbot