Skip to content

Instantly share code, notes, and snippets.

View florian-kalisch's full-sized avatar

florian-kalisch

View GitHub Profile
https://medium.com/@harishhacker3010/can-we-make-any-smaller-opensource-ai-models-smarter-than-human-1ea507e644a0
Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches.
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed.
Use <count> tags after each step to show the remaining budget. Stop when reaching 0.
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress.
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process.
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach:
0.8+: Continue current approach
import requests
# Define your App ID, App Secret, and short-lived token
app_id = ''
app_secret = ''
short_lived_token = ''
# URL for the token extension
url = 'https://graph.facebook.com/v14.0/oauth/access_token'
@florian-kalisch
florian-kalisch / environment.yml
Created September 23, 2023 14:21 — forked from cjtu/environment.yml
OLS regression tutorial with statsmodels in Python
channels:
- conda-forge
dependencies:
- statsmodels
- numpy
- matplotlib
@florian-kalisch
florian-kalisch / Code.gs
Last active August 28, 2023 20:25
AppsScript (Sheets) TimeTracking
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('TimeTracking')
.addItem('Start', 'startTimer')
.addItem('Stop', 'stopTimer')
.addToUi();
}
function startTimer() {
var startTime = new Date();
@florian-kalisch
florian-kalisch / example_1.md
Created June 15, 2023 18:59
gpt-4 vs gpt-4-0314

Example

Background

This is a feature from my project "Chat with Documents", where a human asks a question and GPT answers based on a collection of documents. Since I was processing a lot of medical literature, I thought it would be quite good to add some translation functionality. I started with the integration of "argostranslate". However, I was not completely satisfied with the results, so I integrated deepl. Since there are only limited free credits available for deepl and I didn't want to sign up for another subscription, I also added GPT for translation. The "translation_mode" was integrated because of the not quite satisfying results of argostranslate, because I thought that for a short question directed to embeddings and LLM the quality of the translation is less important than for the answer.

Language of human and machine are defined manually. Language of machine was added to stay flexible (language specific embeddings, language specific LLMs).

The following "translation_mode" exist:

  • "no tra
@florian-kalisch
florian-kalisch / main.py
Created May 14, 2023 21:12
Weather data Germany
import warnings
import pandas as pd
from wetterdienst import Settings
from wetterdienst.provider.dwd.observation import (
DwdObservationRequest,
DwdObservationParameter,
DwdObservationResolution,
DwdObservationPeriod,
)
def extract_python_code_test(input_string):
lines = input_string.split('\n')
num_lines = len(lines)
max_extra_lines = 10
# Limit the search to a reasonable number of extra lines
start_range = min(num_lines, max_extra_lines + 1)
end_range = min(num_lines, max_extra_lines + 1)
@florian-kalisch
florian-kalisch / _InbentaApiMethods.md
Created September 18, 2022 19:22 — forked from jalcantarab/_InbentaApiMethods.md
Google App Script Examples of some of the Inbenta API endpoints

Inbenta API - Google Apps Script Examples (~JavaScript)

Check out the official documentation of the Inbenta API at Getting Started. This gist is done for API version v1. To check out SDK examples in JavaScript, check this out

Overview

All the API access is over HTTPS. The response format for all requests is a JSON object. Whether a request succeeded is indicated by the HTTP status code. A 2xx status code indicates success, otherwise failure. When a request fails, the response body is still JSON.

Authentication

Authentication is done via HTTP headers, more information in the Authorization section. The calls in this gist all authenticate doing a call to getApiData(), which retrieves a token from POST /auth, and the list of api endpoints from GET /apis.

@florian-kalisch
florian-kalisch / README.md
Created June 2, 2021 13:34
DynamoDB select random record

DynamoDB random record

This is a node.js implementation for selecting a random record from DynamoDB table with the least amount of reads according to this solution.

@florian-kalisch
florian-kalisch / cognito.yaml
Created May 14, 2021 16:02 — forked from mtinra/cognito.yaml
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
API_ID:
Type: String
Despription: API Gateway ID