aragoni5051 / MediCompass

1 stars 0 forks source link

GPT 학습 #9

Open heejunkim00 opened 1 month ago

heejunkim00 commented 1 month ago

증상별 어느 병원을 가야하는 지 대략적으로 정리해놓은거야 참고하도록 해

내과

신경과

외과

정형외과

피부과

이비인후과

heejunkim00 commented 1 month ago

api_key=os.getenv('CHATGPT_API_KEY')

heejunkim00 commented 1 month ago

sk-proj-V4pjvGotnN3fBb8aDk62T3BlbkFJwZimtgtrWME1AnHb9lcK

heejunkim00 commented 1 month ago

nano ~/.bashrc export OPENAI_API_KEY="your-api-key"

heejunkim00 commented 1 month ago

source ~/.bashrc

heejunkim00 commented 1 month ago
llm_type: Literal['chatgpt', 'huggingface'] = Field(
    alias='Large Language Model Type',
    description='사용할 LLM 종류',
    default='chatgpt',
)
heejunkim00 commented 1 month ago

echo $OPENAI_API_KEY

heejunkim00 commented 1 month ago

_MODELS: list[BaseLLMModel] = [ ChatGPTModel( name='chatgpt', api_key="sk-proj-V4pjvGotnN3fBb8aDk62T3BlbkFJwZimtgtrWME1AnHb9lcK" ), HuggingFaceEndpointModel( name='huggingface', api_key="sk-proj-V4pjvGotnN3fBb8aDk62T3BlbkFJwZimtgtrWME1AnHb9lcK" ), ]

heejunkim00 commented 1 month ago
base:str = Field(
    default = load_path("prompts/base.txt")
)

form:str = Field(
    default=load_path("prompts/form.txt")
)
heejunkim00 commented 1 month ago

def load_path(file_path): if os.path.exists(file_path): with open(file_path, 'r', encoding='utf-8') as file: text = file.read() else: raise FileNotFoundError(f"{file_path} 파일을 찾을 수 없습니다.") return text