Yersel commited on
Commit
959e1eb
1 Parent(s): bdc9656

verificacion de instalacion de librerias

Browse files
Files changed (1) hide show
  1. app.py +10 -0
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