AstraBert commited on
Commit
df7e912
1 Parent(s): 37bc926
Files changed (3) hide show
  1. .gitignore +1 -0
  2. api.py +8 -0
  3. load_model.py +1 -1
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ ./api.py
api.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from gradio_client import Client
2
+
3
+ client = Client("as-cle-bert/bloom-multilingual-chat")
4
+ result = client.predict(
5
+ message="Hello!!",
6
+ api_name="/chat"
7
+ )
8
+ print(result)
load_model.py CHANGED
@@ -3,4 +3,4 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
3
  model = AutoModelForCausalLM.from_pretrained("bigscience/bloom-1b7")
4
  tokenizer = AutoTokenizer.from_pretrained("bigscience/bloom-1b7")
5
 
6
- pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, max_new_tokens=2048, repetition_penalty=1.2)
 
3
  model = AutoModelForCausalLM.from_pretrained("bigscience/bloom-1b7")
4
  tokenizer = AutoTokenizer.from_pretrained("bigscience/bloom-1b7")
5
 
6
+ pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, max_new_tokens=2048, repetition_penalty=1.2, temperature=0.4)