Skip to content

Instantly share code, notes, and snippets.

View cyyeh's full-sized avatar
👋
Focusing

Chih-Yu Yeh cyyeh

👋
Focusing
View GitHub Profile
@cyyeh
cyyeh / all.sql
Last active November 3, 2023 03:15
長庚poc
{% if context.params.rectype != 'PETscan' and
context.params.rectype != 'PETreport' and
context.params.rectype != 'PETprepare' and
context.params.rectype != 'PETinj' %}
{% error "rectype should be PETscan, PETreport, PETprepare or PETinj" %}
{% endif %}
{% set body = {"body": {"chtno": context.params.chtno, "deptNo": context.params.deptno, "recType": context.params.rectype}} %}
select
@cyyeh
cyyeh / test_ollama.py
Created May 21, 2024 00:03
Test Ollama using OpenAI compatible API
from openai import OpenAI
client = OpenAI(
api_key='ollama',
base_url="http://localhost:11434/v1",
)
# this will fail, showing openai.NotFoundError: 404 page not found
data = client.embeddings.create(
input='hi',