Spaces:
Running
Running
Update utils.py
Browse files
utils.py
CHANGED
@@ -6,11 +6,12 @@ import streamlit as st
|
|
6 |
from openai import OpenAI
|
7 |
from sshtunnel import SSHTunnelForwarder
|
8 |
|
|
|
9 |
|
10 |
@st.cache_resource()
|
11 |
def load_model():
|
12 |
openai_api_key = "EMPTY"
|
13 |
-
openai_api_base = "http://localhost:
|
14 |
|
15 |
client = OpenAI(
|
16 |
api_key=openai_api_key,
|
@@ -63,7 +64,7 @@ def start_server(ssh_key, dns_name):
|
|
63 |
ssh_address_or_host=dns_name,
|
64 |
ssh_username="ec2-user",
|
65 |
ssh_pkey=pkey,
|
66 |
-
local_bind_address=("127.0.0.1",
|
67 |
remote_bind_address=("127.0.0.1", 8000)
|
68 |
)
|
69 |
|
|
|
6 |
from openai import OpenAI
|
7 |
from sshtunnel import SSHTunnelForwarder
|
8 |
|
9 |
+
local_port = 20000
|
10 |
|
11 |
@st.cache_resource()
|
12 |
def load_model():
|
13 |
openai_api_key = "EMPTY"
|
14 |
+
openai_api_base = f"http://localhost:{local_port}/v1"
|
15 |
|
16 |
client = OpenAI(
|
17 |
api_key=openai_api_key,
|
|
|
64 |
ssh_address_or_host=dns_name,
|
65 |
ssh_username="ec2-user",
|
66 |
ssh_pkey=pkey,
|
67 |
+
local_bind_address=("127.0.0.1", local_port),
|
68 |
remote_bind_address=("127.0.0.1", 8000)
|
69 |
)
|
70 |
|