Update app.py
Browse files
app.py
CHANGED
|
@@ -22,11 +22,6 @@ model_id = "mistralai/Mistral-7B-v0.3"
|
|
| 22 |
model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 23 |
|
| 24 |
|
| 25 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id, token= token)
|
| 26 |
-
|
| 27 |
-
model = AutoModelForCausalLM.from_pretrained(model_id, token= token, torch_dtype=torch.bfloat16,attn_implementation="flash_attention_2",)
|
| 28 |
-
|
| 29 |
-
|
| 30 |
|
| 31 |
|
| 32 |
@spaces.GPU(duration=180)
|
|
@@ -38,6 +33,12 @@ def respond(
|
|
| 38 |
temperature,
|
| 39 |
top_p,
|
| 40 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
messages = [
|
| 42 |
{"role": "user", "content": "What is your favourite condiment?"},
|
| 43 |
{"role": "assistant", "content": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"},
|
|
|
|
| 22 |
model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 23 |
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
@spaces.GPU(duration=180)
|
|
|
|
| 33 |
temperature,
|
| 34 |
top_p,
|
| 35 |
):
|
| 36 |
+
|
| 37 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, token= token)
|
| 38 |
+
|
| 39 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, token= token, torch_dtype=torch.bfloat16,attn_implementation="flash_attention_2",)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
messages = [
|
| 43 |
{"role": "user", "content": "What is your favourite condiment?"},
|
| 44 |
{"role": "assistant", "content": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"},
|