Spaces:
Runtime error
Runtime error
Update llm.py
Browse files
llm.py
CHANGED
|
@@ -11,7 +11,7 @@ def invoke_llm(context, task):
|
|
| 11 |
Write in a formal language and in portuguese language.
|
| 12 |
Execute the task just based on the given context.
|
| 13 |
Your task is: <{task}>
|
| 14 |
-
The context is: <{context>
|
| 15 |
"""
|
| 16 |
|
| 17 |
llm=ChatOpenAI(model_name="gpt-3.5-turbo",
|
|
@@ -24,20 +24,3 @@ def invoke_llm(context, task):
|
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
-
# def generate_topics(text):
|
| 28 |
-
# prompt = f"""You are an assistant of a newspaper.
|
| 29 |
-
# Your task is to extract relevant topics of a news and build a concise road map.
|
| 30 |
-
# Do not make up any information, create the road map just based on the given information.
|
| 31 |
-
# The road map should be written in a formal language and in portuguese language.
|
| 32 |
-
# Answer just the information, do not put any title.
|
| 33 |
-
# The road map should be about the following context: {text}
|
| 34 |
-
# """
|
| 35 |
-
#
|
| 36 |
-
# llm=ChatOpenAI(model_name="gpt-3.5-turbo",
|
| 37 |
-
# temperature=0,
|
| 38 |
-
# openai_api_key=api_key.OPENAI_KEY,
|
| 39 |
-
# max_tokens=1000)
|
| 40 |
-
# result = llm.invoke(prompt)
|
| 41 |
-
# return result.content
|
| 42 |
-
|
| 43 |
-
|
|
|
|
| 11 |
Write in a formal language and in portuguese language.
|
| 12 |
Execute the task just based on the given context.
|
| 13 |
Your task is: <{task}>
|
| 14 |
+
The context is: <{context}>
|
| 15 |
"""
|
| 16 |
|
| 17 |
llm=ChatOpenAI(model_name="gpt-3.5-turbo",
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|