Spaces:
Runtime error
Runtime error
adjust zeroGPU
Browse files- sotopia_generate.py +1 -3
- sotopia_space/chat.py +1 -1
sotopia_generate.py
CHANGED
|
@@ -37,7 +37,6 @@ OutputType = TypeVar("OutputType", bound=object)
|
|
| 37 |
log = logging.getLogger("generate")
|
| 38 |
logging_handler = LoggingCallbackHandler("langchain")
|
| 39 |
|
| 40 |
-
# @spaces.GPU
|
| 41 |
def generate_action(
|
| 42 |
model_name: str,
|
| 43 |
history: str,
|
|
@@ -82,7 +81,6 @@ def generate_action(
|
|
| 82 |
# print(e)
|
| 83 |
# return AgentAction(action_type="none", argument="")
|
| 84 |
|
| 85 |
-
@spaces.GPU(duration=1200)
|
| 86 |
@cache
|
| 87 |
def prepare_model(model_name):
|
| 88 |
compute_type = torch.float16
|
|
@@ -151,7 +149,7 @@ def obtain_chain_hf(
|
|
| 151 |
chain = LLMChain(llm=hf, prompt=chat_prompt_template)
|
| 152 |
return chain
|
| 153 |
|
| 154 |
-
|
| 155 |
def generate(
|
| 156 |
model_name: str,
|
| 157 |
template: str,
|
|
|
|
| 37 |
log = logging.getLogger("generate")
|
| 38 |
logging_handler = LoggingCallbackHandler("langchain")
|
| 39 |
|
|
|
|
| 40 |
def generate_action(
|
| 41 |
model_name: str,
|
| 42 |
history: str,
|
|
|
|
| 81 |
# print(e)
|
| 82 |
# return AgentAction(action_type="none", argument="")
|
| 83 |
|
|
|
|
| 84 |
@cache
|
| 85 |
def prepare_model(model_name):
|
| 86 |
compute_type = torch.float16
|
|
|
|
| 149 |
chain = LLMChain(llm=hf, prompt=chat_prompt_template)
|
| 150 |
return chain
|
| 151 |
|
| 152 |
+
@spaces.GPU
|
| 153 |
def generate(
|
| 154 |
model_name: str,
|
| 155 |
template: str,
|
sotopia_space/chat.py
CHANGED
|
@@ -10,7 +10,7 @@ from sotopia_generate import prepare_model, generate_action
|
|
| 10 |
from sotopia_space.constants import MODEL_OPTIONS
|
| 11 |
|
| 12 |
DEPLOYED = os.getenv("DEPLOYED", "true").lower() == "true"
|
| 13 |
-
DEFAULT_MODEL_SELECTION = "
|
| 14 |
TEMPERATURE = 0.7
|
| 15 |
TOP_P = 1
|
| 16 |
MAX_TOKENS = 1024
|
|
|
|
| 10 |
from sotopia_space.constants import MODEL_OPTIONS
|
| 11 |
|
| 12 |
DEPLOYED = os.getenv("DEPLOYED", "true").lower() == "true"
|
| 13 |
+
DEFAULT_MODEL_SELECTION = "cmu-lti/sotopia-pi-mistral-7b-BC_SR"
|
| 14 |
TEMPERATURE = 0.7
|
| 15 |
TOP_P = 1
|
| 16 |
MAX_TOKENS = 1024
|