start cases
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
print("running __main__.-py")
|
print("running __main__.-py")
|
||||||
|
|
||||||
from chatbug.llama import main
|
from chatbug.llama import main_func
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main_func()
|
@@ -36,11 +36,11 @@ def initialize_config(inference: Inference) -> Terminal:
|
|||||||
return terminal
|
return terminal
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main_func():
|
||||||
inference = Inference(model_selection.get_model())
|
inference = Inference(model_selection.get_model())
|
||||||
terminal = initialize_config(inference)
|
terminal = initialize_config(inference)
|
||||||
terminal.join()
|
terminal.join()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main_func()
|
@@ -2,8 +2,6 @@ import random
|
|||||||
import datetime
|
import datetime
|
||||||
from chatbug.tool_helper import tool
|
from chatbug.tool_helper import tool
|
||||||
import chatbug.matheval as matheval
|
import chatbug.matheval as matheval
|
||||||
# from chatbug.matheval import interpreter, lexer
|
|
||||||
# from chatbug.matheval.ast import Parser
|
|
||||||
import chatbug.utils as utils
|
import chatbug.utils as utils
|
||||||
|
|
||||||
|
|
||||||
@@ -58,10 +56,10 @@ Args:
|
|||||||
expression = "solve " + " and ".join(equations) + " for " + " and ".join(variables)
|
expression = "solve " + " and ".join(equations) + " for " + " and ".join(variables)
|
||||||
print(expression)
|
print(expression)
|
||||||
|
|
||||||
tokens = lexer.tokenize(expression)
|
tokens = matheval.lexer.tokenize(expression)
|
||||||
parser = ast.Parser()
|
parser = ast.Parser()
|
||||||
ast = parser.parse(tokens)
|
ast = parser.parse(tokens)
|
||||||
return interpreter.interpret(ast)
|
return matheval.interpreter.interpret(ast)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
utils.print_error("Tool call evaluation failed. - " + str(e))
|
utils.print_error("Tool call evaluation failed. - " + str(e))
|
||||||
return "Tool call evaluation failed."
|
return "Tool call evaluation failed."
|
||||||
|
16
setup.py
16
setup.py
@@ -14,9 +14,15 @@ setup(
|
|||||||
'pytest',
|
'pytest',
|
||||||
'pywebview',
|
'pywebview',
|
||||||
],
|
],
|
||||||
# entry_points={
|
entry_points={
|
||||||
# 'console_scripts': [
|
'console_scripts': [
|
||||||
# 'chatbug=chatbug.app:main',
|
'chatbug=chatbug.llama:main_func',
|
||||||
# ],
|
# a^ b^ c^ d^
|
||||||
# },
|
# a => the command line argument
|
||||||
|
# b => the package name
|
||||||
|
# c => the file name in the package (same as imports)
|
||||||
|
# d => the function to call
|
||||||
|
'chatbugui=chatbug.ui.__main__:start_ui',
|
||||||
|
],
|
||||||
|
},
|
||||||
)
|
)
|
Reference in New Issue
Block a user