Skip to content

Instantly share code, notes, and snippets.

View josemcorderoc's full-sized avatar

José Carvacho josemcorderoc

View GitHub Profile
@maxim-saplin
maxim-saplin / openai_function_calling.ts
Created September 5, 2023 05:42
Open AI function calling to enforce LLM response structure/format
import dotenv from "dotenv";
const API_KEY = process.env.API_KEY;
const API_ENDPOINT = process.env.API_ENDPOINT; // ?api-version=2023-07-01-preview is required as of August 2023
const validate = async (name: string, project: string, role: string, category: string, feedback: string, summary: string): Promise<{ status: string, recommendations: string }> => {
var nominee = generateNomineeString(name, project, role, category, feedback, summary);
// Using function call capability of OpenAI API to ensure response is properly formatted JSON
// Before function calling I asked to reply via JSON, one of side effect was that in 'recomendations'
@turicas
turicas / Transcrição de textos em Português com whisper (OpenAI).ipynb
Last active February 12, 2026 13:14
Transcrição de textos em Português com whisper (OpenAI)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtzero
jtzero / Jupyter command find_spark_home.py not found
Last active February 11, 2025 16:50
Jupyter command `jupyter-/home/jtzero/.local/share/virtualenvs/ml-.../bin/find_spark_home.py` not found.
```
(email_ml) jtzero:~/Documents/ml$ PYSPARK_DRIVER_PYTHON=jupyter PYSPARK_DRIVER_PYTHON_OPTS='notebook' pyspark
Traceback (most recent call last):
File "/home/jtzero/.local/share/virtualenvs/ml-PBkX3P8r/bin/jupyter", line 8, in <module>
sys.exit(main())
File "/home/jtzero/.local/share/virtualenvs/ml-PBkX3P8r/lib/python3.7/site-packages/jupyter_core/command.py", line 247, in main
command = _jupyter_abspath(subcommand)
File "/home/jtzero/.local/share/virtualenvs/ml-PBkX3P8r/lib/python3.7/site-packages/jupyter_core/command.py", line 134, in _jupyter_abspath
'Jupyter command `{}` not found.'.format(jupyter_subcommand)
Exception: Jupyter command `jupyter-/home/jtzero/.local/share/virtualenvs/ml-PBkX3P8r/bin/find_spark_home.py` not found.
@jitsejan
jitsejan / Dockerfile
Last active August 18, 2024 09:53
PySpark, Docker and S3
FROM jupyter/pyspark-notebook
USER root
# Add essential packages
RUN apt-get update && apt-get install -y build-essential curl git gnupg2 nano apt-transport-https software-properties-common
# Set locale
RUN apt-get update && apt-get install -y locales \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen
# Add config to Jupyter notebook
COPY jupyter/jupyter_notebook_config.py /home/jovyan/.jupyter/
FROM alpine:3.10
ARG SPARK_VERSION=3.0.0-preview
ARG HADOOP_VERSION_SHORT=3.2
ARG HADOOP_VERSION=3.2.0
ARG AWS_SDK_VERSION=1.11.375
RUN apk add --no-cache bash openjdk8-jre python3
# Download and extract Spark
@racydata
racydata / clustering.ipynb
Created July 29, 2019 00:38
Clustering of pornhub videos/playlists
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ejlp12
ejlp12 / aws_glue_boto3_example.md
Last active March 22, 2022 18:29
AWS Glue Create Crawler, Run Crawler and update Table to use "org.apache.hadoop.hive.serde2.OpenCSVSerde"
import boto3

client = boto3.client('glue')

response = client.create_crawler(
    Name='SalesCSVCrawler',
    Role='AWSGlueServiceRoleDefault',
    DatabaseName='sales-cvs',
    Description='Crawler for generated Sales schema',
@ppizarror
ppizarror / boostrap v4 w3c fix
Created October 9, 2018 02:09
Boostrap v4 w3c sanitized
@media print {
*, ::after, ::before {
text-shadow: none !important;
box-shadow: none !important
}
a, a:visited {
text-decoration: underline
}
@ColinTalbert
ColinTalbert / foliumlegend.ipynb
Created September 14, 2018 18:22
folium categorical legend
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ymdx
ymdx / index.js
Created December 18, 2017 15:05
How to download CSV File from HttpResponse with Ajax
success: function(data) {
var blob=new Blob([data]);
var link=document.createElement('a');
link.href=window.URL.createObjectURL(blob);
link.download="<FILENAME_TO_SAVE_WITH_EXTENSION>";
link.click();
}