Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging Gentopia #19

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gentopia/assembler/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ def file(self, node: yaml.Node) -> Any:
if not filename.is_absolute():
filename = self._root / filename
with open(filename, 'r') as f:
return f.read()
return f.read().strip()
1 change: 0 additions & 1 deletion gentopia/llm/client/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ def function_chat_completion(self, message: List[dict],
presence_penalty=self.params.presence_penalty,
)
response_message = response.choices[0]["message"]
print("!!!!!", response_message)

if response_message.get("function_call"):
function_name = response_message["function_call"]["name"]
Expand Down
2 changes: 1 addition & 1 deletion main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ plugins:

# Authentication
auth:
OPENAI_API_KEY: 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
OPENAI_API_KEY: !file /home/billxbf/Documents/myks/openai.key
14 changes: 14 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fastapi==0.98.0
geopy==2.3.0
langchain==0.0.209
optimum==1.8.6
peft==0.4.0.dev0
pydantic==1.10.9
pytest==7.3.2
PyYAML==6.0
PyYAML==6.0
Requests==2.31.0
setuptools==67.8.0
torch==2.0.1
transformers==4.31.0.dev0
uvicorn==0.22.0
29 changes: 29 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from setuptools import setup, find_packages

setup(
name='gentopia',
version='0.1',
packages=find_packages(),
url='https://github.com/Gentopia-AI/Gentopia',
license='Apache-2.0 license',
author='billxbf',
author_email='billxbf@gmail.com',
description='Gentopia assembles and serves specialized ALM agents driven by configs.',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
install_requires=[
'fastapi',
'geopy',
'langchain',
'optimum',
'peft',
'pydantic',
'pytest',
'PyYAML',
'requests',
'setuptools',
'torch',
'transformers',
'uvicorn',
],
)
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def print_tree(obj, indent=0):
if __name__ == '__main__':
mp.set_start_method('spawn', force=True)
config = Config.load('main.yaml')
print(config)
#print(config)
# exit(0)
assembler = AgentAssembler(file='main.yaml')
#assembler.manager = LocalLLMManager()
agent = assembler.get_agent()
ans = ""
response = agent.run("what is the square root of 23?")
response = agent.run("who is Leonardo da Vinci's first wife?")
print(response)
# for i in agent.llm.stream_chat_completion("what is the square root of 23?"):
# print(i)
Expand Down