Skip to content

Instantly share code, notes, and snippets.

View iamaziz's full-sized avatar
🎲

Aziz Alto iamaziz

🎲
View GitHub Profile
@iamaziz
iamaziz / ollachat_ar.py
Last active April 18, 2024 00:01
Ollama UI for Arabic (right-to-left) based on: https://github.com/iamaziz/ollachat (example in the comments)
import os
import json
import datetime
import streamlit as st
from llama_index.llms import Ollama
from llama_index.llms import ChatMessage
# https://docs.llamaindex.ai/en/stable/examples/llm/ollama.html
@iamaziz
iamaziz / Jais-LLM-GettingStarted-v2.ipynb
Last active April 16, 2024 16:59
Running Jais LLM on M3 Max chip with 64GB - using `torch_dtype=torch.float16`. Now much faster but way off
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import torch
from langchain_community.embeddings import (
OpenAIEmbeddings,
OllamaEmbeddings,
HuggingFaceEmbeddings,
HuggingFaceBgeEmbeddings
)
def embedding_func(selected_embedding: str = "HuggingFaceEmbeddings"):
"""
@iamaziz
iamaziz / LLM-from-scratch.ipynb
Created July 23, 2023 17:02
Building a large language model (LLM) from scratch (for learning and fun - inspired by Llama2).
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / code_completion_ide.py
Last active February 25, 2024 02:20
simple offline code completion example with ollama/streamlit and code execution
import sys
from io import StringIO
import streamlit as st # pip install streamlit
from code_editor import code_editor # pip install streamlit_code_editor
import ollama as ol # pip install ollama
st.set_page_config(layout='wide')
st.title('`Offline code completion`')
@iamaziz
iamaziz / arabic_llm.ipynb
Last active February 22, 2024 07:47
Out-of-the-box open LLM generating Arabic text
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / custom_arabic_llm.ipynb
Created February 22, 2024 07:08
Custom open `local` LLMs (Ollama) for Arabic language
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / custom_arabic_llm.ipynb
Last active February 22, 2024 07:07
Custom open `local` LLMs (Ollama) for Arabic language
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / fast_speech_text_speech_steramlit_app.py
Last active February 16, 2024 17:54 — forked from thomwolf/fast_speech_text_speech.py
speech to text to speech (Srteamlit App) - example in the comments
""" To use: install Ollama (or LLM studio), clone OpenVoice, run this script in the OpenVoice directory
git clone https://github.com/myshell-ai/OpenVoice
cd OpenVoice
git clone https://huggingface.co/myshell-ai/OpenVoice
cp -r OpenVoice/* .
pip install whisper pynput pyaudio streamlit ollama
script source: https://x.com/Thom_Wolf/status/1758140066285658351?s=20
"""