Spaces:
Sleeping
Sleeping
verificacion de instalacion de librerias
Browse files
app.py
CHANGED
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
2 |
from huggingface_hub import login
|
3 |
import torch
|
|
|
1 |
+
import subprocess
|
2 |
+
|
3 |
+
# Ensure the required libraries are installed
|
4 |
+
def install(package):
|
5 |
+
subprocess.check_call([os.sys.executable, "-m", "pip", "install", package])
|
6 |
+
|
7 |
+
# Install transformers, huggingface_hub
|
8 |
+
install("transformers")
|
9 |
+
install("huggingface_hub")
|
10 |
+
|
11 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
12 |
from huggingface_hub import login
|
13 |
import torch
|