aliceblue11 commited on
Commit
3353e65
·
verified ·
1 Parent(s): 398cd15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
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
- 환경 변수에서 HuggingFace API 토큰을 가져옴.
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(