Spaces:
Sleeping
Sleeping
Anna Zhou commited on
Commit Β·
97d58d9
1
Parent(s): 64b2279
Switch hosted app to OpenAI model
Browse files- app/app.py +1 -1
- rag/pipeline.py +1 -1
app/app.py
CHANGED
|
@@ -509,7 +509,7 @@ with st.sidebar:
|
|
| 509 |
else:
|
| 510 |
st.caption("β Full context provided.")
|
| 511 |
|
| 512 |
-
model_choice = "
|
| 513 |
|
| 514 |
# ββ Two-column layout βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 515 |
main_col, history_col = st.columns([2, 1], gap="large")
|
|
|
|
| 509 |
else:
|
| 510 |
st.caption("β Full context provided.")
|
| 511 |
|
| 512 |
+
model_choice = "openai"
|
| 513 |
|
| 514 |
# ββ Two-column layout βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 515 |
main_col, history_col = st.columns([2, 1], gap="large")
|
rag/pipeline.py
CHANGED
|
@@ -44,7 +44,7 @@ def query_claude(prompt: str, max_tokens: int = 4096) -> str:
|
|
| 44 |
def query_openai(prompt: str, max_tokens: int = 2048) -> str:
|
| 45 |
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
| 46 |
response = client.chat.completions.create(
|
| 47 |
-
model="gpt-4o-mini",
|
| 48 |
max_completion_tokens=max_tokens,
|
| 49 |
messages=[{"role": "user", "content": prompt}],
|
| 50 |
)
|
|
|
|
| 44 |
def query_openai(prompt: str, max_tokens: int = 2048) -> str:
|
| 45 |
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
| 46 |
response = client.chat.completions.create(
|
| 47 |
+
model=os.getenv("OPENAI_MODEL", "gpt-4o-mini"),
|
| 48 |
max_completion_tokens=max_tokens,
|
| 49 |
messages=[{"role": "user", "content": prompt}],
|
| 50 |
)
|