Update app.py
Browse files
app.py
CHANGED
|
@@ -22,6 +22,12 @@ model_id = "mistralai/Mistral-7B-v0.3"
|
|
| 22 |
model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 23 |
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
@spaces.GPU(duration=180)
|
|
@@ -34,11 +40,7 @@ def respond(
|
|
| 34 |
top_p,
|
| 35 |
):
|
| 36 |
|
| 37 |
-
|
| 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!"},
|
|
|
|
| 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,
|
| 28 |
+
# attn_implementation="flash_attention_2",
|
| 29 |
+
)
|
| 30 |
+
|
| 31 |
|
| 32 |
|
| 33 |
@spaces.GPU(duration=180)
|
|
|
|
| 40 |
top_p,
|
| 41 |
):
|
| 42 |
|
| 43 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
messages = [
|
| 45 |
{"role": "user", "content": "What is your favourite condiment?"},
|
| 46 |
{"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!"},
|