Spaces:
Paused
Paused
Jose Benitez
commited on
Commit
•
52cd2bc
1
Parent(s):
36d916e
update app
Browse files- app.py +9 -0
- requirements.txt +0 -1
app.py
CHANGED
@@ -20,6 +20,15 @@ import gradio as gr
|
|
20 |
import torch
|
21 |
from transformers import AutoModelForCausalLM, AutoTokenizer, StoppingCriteria, StoppingCriteriaList, TextIteratorStreamer
|
22 |
from threading import Thread
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
#tokenizer = AutoTokenizer.from_pretrained("togethercomputer/RedPajama-INCITE-Chat-3B-v1")
|
25 |
#model = AutoModelForCausalLM.from_pretrained("togethercomputer/RedPajama-INCITE-Chat-3B-v1", torch_dtype=torch.float16)
|
|
|
20 |
import torch
|
21 |
from transformers import AutoModelForCausalLM, AutoTokenizer, StoppingCriteria, StoppingCriteriaList, TextIteratorStreamer
|
22 |
from threading import Thread
|
23 |
+
import subprocess
|
24 |
+
|
25 |
+
|
26 |
+
try:
|
27 |
+
__import__("flash_attn")
|
28 |
+
print(f'El paquete ya está instalado.')
|
29 |
+
except ModuleNotFoundError:
|
30 |
+
subprocess.check_call(["python", '-m', 'pip', 'install', 'flash_attn'])
|
31 |
+
print(f'El paquete ha sido instalado.')
|
32 |
|
33 |
#tokenizer = AutoTokenizer.from_pretrained("togethercomputer/RedPajama-INCITE-Chat-3B-v1")
|
34 |
#model = AutoModelForCausalLM.from_pretrained("togethercomputer/RedPajama-INCITE-Chat-3B-v1", torch_dtype=torch.float16)
|
requirements.txt
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
flash_attn
|
2 |
torch==2.0.1
|
3 |
deepspeed
|
4 |
sentencepiece
|
|
|
|
|
1 |
torch==2.0.1
|
2 |
deepspeed
|
3 |
sentencepiece
|