From 78083c4e0a41324fcdebfa535e6c01c8b5e744a7 Mon Sep 17 00:00:00 2001 From: Justin Lee Date: Fri, 1 Nov 2024 13:56:54 -0700 Subject: [PATCH] removed unnecessary files --- docs/source/inference-loop-history.py | 37 --------------------------- docs/source/inference-loop.py | 32 ----------------------- docs/source/inference-streaming.py | 36 -------------------------- docs/source/inference.py | 22 ---------------- 4 files changed, 127 deletions(-) delete mode 100644 docs/source/inference-loop-history.py delete mode 100644 docs/source/inference-loop.py delete mode 100644 docs/source/inference-streaming.py delete mode 100644 docs/source/inference.py diff --git a/docs/source/inference-loop-history.py b/docs/source/inference-loop-history.py deleted file mode 100644 index 5dc61fc51..000000000 --- a/docs/source/inference-loop-history.py +++ /dev/null @@ -1,37 +0,0 @@ -import asyncio - -from llama_stack_client import LlamaStackClient -from llama_stack_client.types import UserMessage -from termcolor import cprint - -client = LlamaStackClient( - base_url="http://localhost:5000", -) - - -async def chat_loop(): - conversation_history = [] - - while True: - user_input = input("User> ") - if user_input.lower() in ["exit", "quit", "bye"]: - cprint("Ending conversation. Goodbye!", "yellow") - break - - user_message = UserMessage(content=user_input, role="user") - conversation_history.append(user_message) - - response = client.inference.chat_completion( - messages=conversation_history, - model="Llama3.2-11B-Vision-Instruct", - ) - - cprint(f"> Response: {response.completion_message.content}", "cyan") - - assistant_message = UserMessage( - content=response.completion_message.content, role="user" - ) - conversation_history.append(assistant_message) - - -asyncio.run(chat_loop()) diff --git a/docs/source/inference-loop.py b/docs/source/inference-loop.py deleted file mode 100644 index 031f22d5e..000000000 --- a/docs/source/inference-loop.py +++ /dev/null @@ -1,32 +0,0 @@ -import asyncio - -from llama_stack_client import LlamaStackClient -from llama_stack_client.lib.inference.event_logger import EventLogger -from llama_stack_client.types import UserMessage -from termcolor import cprint - -client = LlamaStackClient( - base_url="http://localhost:5000", -) - - -async def chat_loop(): - while True: - - user_input = input("User> ") - - if user_input.lower() in ["exit", "quit", "bye"]: - cprint("Ending conversation. Goodbye!", "yellow") - break - - message = UserMessage(content=user_input, role="user") - - response = client.inference.chat_completion( - messages=[message], - model="Llama3.2-11B-Vision-Instruct", - ) - - cprint(f"> Response: {response.completion_message.content}", "cyan") - - -asyncio.run(chat_loop()) diff --git a/docs/source/inference-streaming.py b/docs/source/inference-streaming.py deleted file mode 100644 index 85afbb4af..000000000 --- a/docs/source/inference-streaming.py +++ /dev/null @@ -1,36 +0,0 @@ -import asyncio - -from llama_stack_client import LlamaStackClient -from llama_stack_client.lib.inference.event_logger import EventLogger -from llama_stack_client.types import UserMessage -from termcolor import cprint - - -async def run_main(stream: bool = True): - client = LlamaStackClient( - base_url=f"http://localhost:5000", - ) - - message = UserMessage( - content="hello world, write me a 2 sentence poem about the moon", role="user" - ) - print(f"User>{message.content}", "green") - - response = client.inference.chat_completion( - messages=[message], - model="Llama3.2-11B-Vision-Instruct", - stream=stream, - ) - - if not stream: - cprint(f"> Response: {response}", "cyan") - else: - async for log in EventLogger().log(response): - log.print() - - models_response = client.models.list() - print(models_response) - - -if __name__ == "__main__": - asyncio.run(run_main()) diff --git a/docs/source/inference.py b/docs/source/inference.py deleted file mode 100644 index 82f014887..000000000 --- a/docs/source/inference.py +++ /dev/null @@ -1,22 +0,0 @@ -import asyncio - -from llama_stack_client import LlamaStackClient -from llama_stack_client.lib.inference.event_logger import EventLogger -from llama_stack_client.types import UserMessage -from termcolor import cprint - - -client = LlamaStackClient( - base_url=f"http://localhost:5000", -) -message = UserMessage( - content="hello world, write me a 2 sentence poem about the moon", role="user" -) - -cprint(f"User>{message.content}", "green") -response = client.inference.chat_completion( - messages=[message], - model="Llama3.2-11B-Vision-Instruct", -) - -cprint(f"> Response: {response.completion_message.content}", "cyan")