Push a new model:
ollama pull llama2
echo "FROM llama2" >> Modelfile
echo "SYSTEM You are a friendly assistant." >> Modelfile
ollama create -f Modelfile mertbozkir/test
ollama push mertbozkir/test
or push an existing model:
from langchain_groq import ChatGroq | |
from langchain_core.prompts import ChatPromptTemplate | |
from langchain.schema import StrOutputParser | |
from langchain.schema.runnable import Runnable | |
from langchain.schema.runnable.config import RunnableConfig | |
from typing import Dict, Optional | |
import chainlit as cl | |
import logging | |
from chainlit import logger |
Push a new model:
ollama pull llama2
echo "FROM llama2" >> Modelfile
echo "SYSTEM You are a friendly assistant." >> Modelfile
ollama create -f Modelfile mertbozkir/test
ollama push mertbozkir/test
or push an existing model:
# Based on evan's prompt | |
# Shows the exit status of the last command if non-zero | |
# Uses "#" instead of "»" when running with elevated privileges | |
# local venv_prompt='$(virtualenv_prompt_info)' | |
# PROMPT='%{${fg_bold[blue]}%}$(virtualenv_prompt_info)' | |
PROMPT="%m %{${fg_bold[red]}%}::%{${fg[green]}%} %3~%{${reset_color}%} $(virtualenv_prompt_info)%(0?. . ${fg[red]}%? )%{${fg[blue]}%}» " | |
# PROMPT="%{${fg_bold[white]}%} %m %{${fg_bold[red]}%}:: %{${fg[green]}%}%3~%(0?. . %{${fg[red]}%}%? )%{${fg[blue]}%}$(virtualenv_prompt_info)» %{${reset_color}%}" | |
ZSH_THEME_VIRTUALENV_PREFIX="" | |
ZSH_THEME_VIRTUALENV_SUFFIX="" |
def plot_importance(model, features, num = len(X), save = False): | |
feature_imp = pd.DataFrame({'Value': model.feature_importances_, 'Feature': features.columns}) | |
plt.figure(figsize = (10, 10)) | |
sns.set(font_scale = 1) | |
sns.barplot(x = 'Value', y = 'Feature', | |
data = feature_imp.sort_values(by = 'Value', ascending = False)[0:num]) | |
plt.title('Features') | |
plt.tight_layout() | |
plt.show() | |
if save: |
def val_curve_params(model, X, y, param_name, param_range, scoring = 'roc_auc', cv = 10): | |
train_score, test_score = validation_curve( | |
model, X = X, y = y, param_name = param_name, param_range = param_range, scoring = scoring, cv = cv) | |
mean_train_score = np.mean(train_score, axis = 1) | |
mean_test_score = np.mean(test_score, axis = 1) | |
plt.plot(param_range, mean_train_score, | |
label = 'Training Score', color = 'b') | |
plt.plot(param_range, mean_test_score, |
def search(nums, target) -> int: | |
high = len(nums) - 1 | |
low, mid = 0, 0 | |
while low <= high: | |
mid = (high + low)// 2 | |
if nums[mid] < target: | |
low = mid + 1 | |
class Solution: | |
def reverse(self, x: int) -> int: | |
ex = str(x) | |
if ex[0] == "-": | |
ex2 = ex[1:] | |
print(ex2[::-1]) | |
if not((-2)**31 < int(ex2[::-1]) < 2**31 - 1): | |
return 0 | |
return ex[0] + str(int(ex2[::-1])) | |
else: |
import numpy as np | |
class Solution: | |
def areaEdge(self, h_w: int, Cuts: List[int]) -> int: | |
Cuts.insert(len(Cuts), h_w) | |
temp_list = Cuts[:-1] | |
temp_list.insert(0,0) | |
Cuts.sort() | |
temp_list.sort() |
def CodelandUsernameValidation(strParam): | |
if (4<len(strParam)<25) or (strParam[0] != str) or strParam[-1] == "_": | |
return False | |
return True | |
# keep this function call here | |
print(CodelandUsernameValidation(input())) | |
""" |