Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1,28 +1,18 @@
|
|
1 |
import os,sys
|
|
|
|
|
|
|
|
|
2 |
|
3 |
# install required packages
|
4 |
-
os.system('pip install
|
5 |
-
os.system('pip install plotly')
|
6 |
-
os.system('pip install matplotlib')
|
7 |
os.system('pip install dgl==1.0.2+cu116 -f https://data.dgl.ai/wheels/cu116/repo.html')
|
8 |
os.environ["DGLBACKEND"] = "pytorch"
|
9 |
print('Modules installed')
|
10 |
|
11 |
-
|
12 |
-
from datasets import load_dataset
|
13 |
-
import gradio as gr
|
14 |
-
from dotenv import load_dotenv
|
15 |
-
|
16 |
-
# 환경 변수 로드
|
17 |
-
load_dotenv()
|
18 |
-
HF_TOKEN = os.getenv("HF_TOKEN")
|
19 |
-
if not HF_TOKEN:
|
20 |
-
print("Warning: HF_TOKEN not found in environment variables. Using default settings.")
|
21 |
-
HF_TOKEN = "YOUR_DEFAULT_TOKEN" # 기본값 설정 또는 에러 처리
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
# 기존 import문들 유지
|
26 |
import plotly.graph_objects as go
|
27 |
import numpy as np
|
28 |
import py3Dmol
|
@@ -36,7 +26,7 @@ from utils.parsers_inference import parse_pdb
|
|
36 |
from model.util import writepdb
|
37 |
from utils.inpainting_util import *
|
38 |
|
39 |
-
#
|
40 |
pipe = pipeline("text-generation",
|
41 |
model="CohereForAI/c4ai-command-r-plus-08-2024",
|
42 |
token=HF_TOKEN)
|
|
|
1 |
import os,sys
|
2 |
+
from huggingface_hub import HfApi
|
3 |
+
|
4 |
+
# Hugging Face 토큰 설정
|
5 |
+
HF_TOKEN = "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" # 실제 토큰으로 교체
|
6 |
|
7 |
# install required packages
|
8 |
+
os.system('pip install -q transformers')
|
9 |
+
os.system('pip install -q plotly')
|
10 |
+
os.system('pip install -q matplotlib')
|
11 |
os.system('pip install dgl==1.0.2+cu116 -f https://data.dgl.ai/wheels/cu116/repo.html')
|
12 |
os.environ["DGLBACKEND"] = "pytorch"
|
13 |
print('Modules installed')
|
14 |
|
15 |
+
# 기존 import문들
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
import plotly.graph_objects as go
|
17 |
import numpy as np
|
18 |
import py3Dmol
|
|
|
26 |
from model.util import writepdb
|
27 |
from utils.inpainting_util import *
|
28 |
|
29 |
+
# LLM과 데이터셋 로드
|
30 |
pipe = pipeline("text-generation",
|
31 |
model="CohereForAI/c4ai-command-r-plus-08-2024",
|
32 |
token=HF_TOKEN)
|