Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
-
import inspect
|
2 |
from tqdm import tqdm
|
3 |
-
path_hf=inspect.getfile(HuggingFacePipeline)
|
4 |
from subprocess import Popen, PIPE as P
|
5 |
from langchain_experimental.tools.python.tool import PythonREPLTool as PYT
|
6 |
from langchain.agents import load_tools, create_structured_chat_agent as Agent,AgentExecutor as Ex, AgentType as Type
|
@@ -17,11 +15,6 @@ torch.set_flush_denormal(True)
|
|
17 |
import importlib.util
|
18 |
import logging
|
19 |
from typing import Any, Dict, Iterator, List, Mapping, Optional
|
20 |
-
with open(path_hf,"r") as f:
|
21 |
-
s=f.read()
|
22 |
-
with open(path_hf,"w") as f:
|
23 |
-
f.write(s.replace(" model = model_cls.from_pretrained(model_id, **_model_kwargs)"," model = torch.compile(model_cls.from_pretrained(model_id, **_model_kwargs),mode='max-autotune')"))
|
24 |
-
from langchain_core.prompts.chat import ChatPromptTemplate, MessagesPlaceholder
|
25 |
#system = '''Respond to the human as helpfully and accurately as possible. You have access to the following tools:
|
26 |
|
27 |
#{tools}
|
|
|
|
|
1 |
from tqdm import tqdm
|
|
|
2 |
from subprocess import Popen, PIPE as P
|
3 |
from langchain_experimental.tools.python.tool import PythonREPLTool as PYT
|
4 |
from langchain.agents import load_tools, create_structured_chat_agent as Agent,AgentExecutor as Ex, AgentType as Type
|
|
|
15 |
import importlib.util
|
16 |
import logging
|
17 |
from typing import Any, Dict, Iterator, List, Mapping, Optional
|
|
|
|
|
|
|
|
|
|
|
18 |
#system = '''Respond to the human as helpfully and accurately as possible. You have access to the following tools:
|
19 |
|
20 |
#{tools}
|