Skip to content

Commit f36d1ad

Browse files
authored
Merge pull request #19 from Gentopia-AI/feature/packaging-for-gentpool
Packaging Gentopia
2 parents 5ae8d6a + 3bbf662 commit f36d1ad

File tree

6 files changed

+47
-5
lines changed

6 files changed

+47
-5
lines changed

gentopia/assembler/loader.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ def file(self, node: yaml.Node) -> Any:
4343
if not filename.is_absolute():
4444
filename = self._root / filename
4545
with open(filename, 'r') as f:
46-
return f.read()
46+
return f.read().strip()

gentopia/llm/client/openai.py

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def function_chat_completion(self, message: List[dict],
117117
presence_penalty=self.params.presence_penalty,
118118
)
119119
response_message = response.choices[0]["message"]
120-
print("!!!!!", response_message)
121120

122121
if response_message.get("function_call"):
123122
function_name = response_message["function_call"]["name"]

main.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ plugins:
4444

4545
# Authentication
4646
auth:
47-
OPENAI_API_KEY: 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
47+
OPENAI_API_KEY: !file /home/billxbf/Documents/myks/openai.key

requirements.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
fastapi==0.98.0
2+
geopy==2.3.0
3+
langchain==0.0.209
4+
optimum==1.8.6
5+
peft==0.4.0.dev0
6+
pydantic==1.10.9
7+
pytest==7.3.2
8+
PyYAML==6.0
9+
PyYAML==6.0
10+
Requests==2.31.0
11+
setuptools==67.8.0
12+
torch==2.0.1
13+
transformers==4.31.0.dev0
14+
uvicorn==0.22.0

setup.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from setuptools import setup, find_packages
2+
3+
setup(
4+
name='gentopia',
5+
version='0.1',
6+
packages=find_packages(),
7+
url='https://github.com/Gentopia-AI/Gentopia',
8+
license='Apache-2.0 license',
9+
author='billxbf',
10+
author_email='billxbf@gmail.com',
11+
description='Gentopia assembles and serves specialized ALM agents driven by configs.',
12+
long_description=open('README.md').read(),
13+
long_description_content_type='text/markdown',
14+
install_requires=[
15+
'fastapi',
16+
'geopy',
17+
'langchain',
18+
'optimum',
19+
'peft',
20+
'pydantic',
21+
'pytest',
22+
'PyYAML',
23+
'requests',
24+
'setuptools',
25+
'torch',
26+
'transformers',
27+
'uvicorn',
28+
],
29+
)

test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def print_tree(obj, indent=0):
3333
if __name__ == '__main__':
3434
mp.set_start_method('spawn', force=True)
3535
config = Config.load('main.yaml')
36-
print(config)
36+
#print(config)
3737
# exit(0)
3838
assembler = AgentAssembler(file='main.yaml')
3939
#assembler.manager = LocalLLMManager()
4040
agent = assembler.get_agent()
4141
ans = ""
42-
response = agent.run("what is the square root of 23?")
42+
response = agent.run("who is Leonardo da Vinci's first wife?")
4343
print(response)
4444
# for i in agent.llm.stream_chat_completion("what is the square root of 23?"):
4545
# print(i)

0 commit comments

Comments
 (0)