Create statement_evaluation_command.py
Browse files
utils/statement_evaluation_command.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from langchain_community.llms import HuggingFaceEndpoint
|
3 |
+
|
4 |
+
_api = os.environ.get("HUGGINGFACEHUB_API_TOKEN")
|
5 |
+
|
6 |
+
def get_response(prompt: str):
|
7 |
+
llm = HuggingFaceEndpoint(
|
8 |
+
repo_id="CineAI/FreeThinker3B",
|
9 |
+
max_length=1200,
|
10 |
+
temperature=0.5,
|
11 |
+
huggingfacehub_api_token=_api,
|
12 |
+
)
|
13 |
+
return llm.invoke(prompt)
|