New image generation model and LLMs#7
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds new versioned assistant scripts (V1.7.1 and V1.8) and documentation, with V1.8 extending the voice-first loop to include Stable Diffusion image generation and terminal previews.
Changes:
- Introduces V1.8 assistant loop with image-generation detection and Stable Diffusion generation.
- Adds V1.8 documentation covering features, requirements, and usage.
- Adds V1.7.1 snapshot (script + README) alongside existing versions.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| V1.8/main.py | New V1.8 assistant implementation including image-generation flow and terminal preview integration. |
| V1.8/README.md | New V1.8 documentation describing features, setup, and limitations. |
| V1.8/test2.py | Small helper script intended to preview a generated image with chafa. |
| V1.7.1/main.py | New V1.7.1 assistant implementation snapshot (pre-image-generation). |
| V1.7.1/README.md | New V1.7.1 documentation describing setup and usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from rich.console import Console | ||
| from rich.text import Text | ||
| from diffusers import StableDiffusionPipeline | ||
| from term_image.image import from_file |
Comment on lines
+24
to
+26
| console = Console() | ||
| terminal_width = os.get_terminal_size().columns | ||
| columns, _ = shutil.get_terminal_size() |
Comment on lines
+128
to
+137
| prompt = image_generation_filter.message.content | ||
| image = pipe(prompt, num_inference_steps=20).images[0] | ||
| image.save("generated_image.png") | ||
| small_width = 60 | ||
| subprocess.run([ | ||
| "chafa", | ||
| "/Users/lakshyaprajapati/Documents/Repositories/generated_image.png", | ||
| "--symbols", "block", | ||
| f"--size={small_width}" | ||
| ]) |
Comment on lines
+80
to
+82
| ## License | ||
|
|
||
| This project does not include a license. Add one if needed. |
Comment on lines
+167
to
+175
| voice_recogniser = sr.Recognizer() | ||
| with sr.Microphone() as source1: | ||
| r.adjust_for_ambient_noise(source1, duration=0.2) | ||
| prompt_text = "*Do you want to continue the conversation? Yes or No?*" | ||
| console.print(Text.from_ansi(format_for_terminal(prompt_text))) | ||
| speak("Do you want to continue the conversation? Yes or No?") | ||
| time.sleep(0.01) | ||
| console.print(Text.from_ansi(format_for_terminal("*Listening for your response...*"))) | ||
| audio1 = voice_recogniser.listen(source1) |
Comment on lines
+182
to
+186
| except sr.UnknownValueError: | ||
| console.print(Text.from_ansi(format_for_terminal("Could not understand audio"))) | ||
| print() | ||
|
|
||
| norm = re.sub(r'[^\w]', '', voice_continue_recogniser).lower() |
Comment on lines
+82
to
+89
| app = os.popen( | ||
| f'mdfind \'kMDItemKind == "Application"\' | grep -i "{target}" | head -n 1' | ||
| ).read().strip() | ||
| if app: | ||
| os.system(f'open "{app}"') | ||
| else: | ||
| os.system(f'open "https://{target.replace(" ", "")}.com"') | ||
| is_app_open += 1 |
Comment on lines
+89
to
+96
| app = os.popen( | ||
| f'mdfind \'kMDItemKind == "Application"\' | grep -i "{target}" | head -n 1' | ||
| ).read().strip() | ||
| if app: | ||
| os.system(f'open "{app}"') | ||
| else: | ||
| os.system(f'open "https://{target.replace(" ", "")}.com"') | ||
| is_app_open += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.