Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import transformers
|
3 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
|
@@ -9,7 +12,7 @@ import threading
|
|
9 |
|
10 |
model_id = "PhysicsWallahAI/Aryabhata-1.0"
|
11 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
12 |
-
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
|
13 |
|
14 |
def process_questions(example):
|
15 |
example["question_text"] = example["question"]
|
|
|
1 |
+
import os
|
2 |
+
os.system("pip install flash-attn --no-build-isolation")
|
3 |
+
|
4 |
import gradio as gr
|
5 |
import transformers
|
6 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
|
|
|
12 |
|
13 |
model_id = "PhysicsWallahAI/Aryabhata-1.0"
|
14 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
15 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto", use_flash_attention=True)
|
16 |
|
17 |
def process_questions(example):
|
18 |
example["question_text"] = example["question"]
|