Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
import random
|
| 4 |
-
from transformers import AutoTokenizer,AutoModelForCausalLM
|
| 5 |
from mySystemPrompt import SYSTEM_PROMPT
|
| 6 |
|
| 7 |
-
bnb_config = BitsAndBytesConfig(load_in_8bit=True)
|
| 8 |
|
| 9 |
# Model which is used
|
| 10 |
checkpoint = "CohereForAI/c4ai-command-r-plus"
|
| 11 |
# Inference client with the model (And HF-token if needed)
|
| 12 |
client = InferenceClient(checkpoint)
|
| 13 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
| 14 |
-
model = AutoModelForCausalLM.from_pretrained(checkpoint
|
| 15 |
# Tokenizer chat template correction(Only works for mistral models)
|
| 16 |
#chat_template = open("mistral-instruct.jinja").read()
|
| 17 |
#chat_template = chat_template.replace(' ', '').replace('\n', '')
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
import random
|
| 4 |
+
from transformers import AutoTokenizer,AutoModelForCausalLM
|
| 5 |
from mySystemPrompt import SYSTEM_PROMPT
|
| 6 |
|
|
|
|
| 7 |
|
| 8 |
# Model which is used
|
| 9 |
checkpoint = "CohereForAI/c4ai-command-r-plus"
|
| 10 |
# Inference client with the model (And HF-token if needed)
|
| 11 |
client = InferenceClient(checkpoint)
|
| 12 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
| 13 |
+
model = AutoModelForCausalLM.from_pretrained(checkpoint)
|
| 14 |
# Tokenizer chat template correction(Only works for mistral models)
|
| 15 |
#chat_template = open("mistral-instruct.jinja").read()
|
| 16 |
#chat_template = chat_template.replace(' ', '').replace('\n', '')
|