Spaces:
Running
Running
Commit ·
3ab6c75
1
Parent(s): 39d9102
Update app.py
Browse files
app.py
CHANGED
|
@@ -447,8 +447,8 @@ def compose_extractive(selected: List[Dict[str, Any]]) -> str:
|
|
| 447 |
|
| 448 |
def synthesize_with_llm(question: str, sentence_lines: List[str], model: str = None, temperature: float = 0.2) -> str:
|
| 449 |
if OPENAI_API_KEY is None or OpenAI is None:
|
| 450 |
-
print("calling LLM api")
|
| 451 |
return None
|
|
|
|
| 452 |
client = OpenAI(api_key=OPENAI_API_KEY)
|
| 453 |
model = model or OPENAI_MODEL
|
| 454 |
print("using: ", model)
|
|
@@ -472,6 +472,7 @@ def synthesize_with_llm(question: str, sentence_lines: List[str], model: str = N
|
|
| 472 |
],
|
| 473 |
temperature=temperature,
|
| 474 |
)
|
|
|
|
| 475 |
return getattr(resp, "output_text", None) or str(resp)
|
| 476 |
except Exception:
|
| 477 |
return None
|
|
|
|
| 447 |
|
| 448 |
def synthesize_with_llm(question: str, sentence_lines: List[str], model: str = None, temperature: float = 0.2) -> str:
|
| 449 |
if OPENAI_API_KEY is None or OpenAI is None:
|
|
|
|
| 450 |
return None
|
| 451 |
+
print("calling LLM api")
|
| 452 |
client = OpenAI(api_key=OPENAI_API_KEY)
|
| 453 |
model = model or OPENAI_MODEL
|
| 454 |
print("using: ", model)
|
|
|
|
| 472 |
],
|
| 473 |
temperature=temperature,
|
| 474 |
)
|
| 475 |
+
print(str(getattr(resp, "output_text", None) or str(resp))
|
| 476 |
return getattr(resp, "output_text", None) or str(resp)
|
| 477 |
except Exception:
|
| 478 |
return None
|