Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
import os
|
4 |
-
from typing import Optional
|
5 |
-
|
6 |
-
#############################
|
7 |
-
# [기본코드] - 수정/삭제 불가
|
8 |
-
#############################
|
9 |
|
10 |
# Cohere Command R+ 모델 ID 정의
|
11 |
COHERE_MODEL = "CohereForAI/c4ai-command-r-plus-08-2024"
|
@@ -13,11 +8,11 @@ COHERE_MODEL = "CohereForAI/c4ai-command-r-plus-08-2024"
|
|
13 |
def get_client():
|
14 |
"""
|
15 |
Cohere Command R+ 모델을 위한 InferenceClient 생성.
|
16 |
-
|
17 |
"""
|
18 |
-
hf_token = os.getenv("HUGGINGFACE_TOKEN")
|
19 |
if not hf_token:
|
20 |
-
raise ValueError("HuggingFace API 토큰이
|
21 |
return InferenceClient(COHERE_MODEL, token=hf_token)
|
22 |
|
23 |
def respond_cohere_qna(
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
import os
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# Cohere Command R+ 모델 ID 정의
|
6 |
COHERE_MODEL = "CohereForAI/c4ai-command-r-plus-08-2024"
|
|
|
8 |
def get_client():
|
9 |
"""
|
10 |
Cohere Command R+ 모델을 위한 InferenceClient 생성.
|
11 |
+
HuggingFace Secrets에서 토큰을 가져옴.
|
12 |
"""
|
13 |
+
hf_token = os.getenv("HUGGINGFACE_TOKEN") # Secrets에서 토큰 가져오기
|
14 |
if not hf_token:
|
15 |
+
raise ValueError("HuggingFace API 토큰이 설정되지 않았습니다.")
|
16 |
return InferenceClient(COHERE_MODEL, token=hf_token)
|
17 |
|
18 |
def respond_cohere_qna(
|