Skip to content

Instantly share code, notes, and snippets.

View hamelsmu's full-sized avatar
💻
Always learning.

Hamel Husain hamelsmu

💻
Always learning.
View GitHub Profile
@hamelsmu
hamelsmu / app.ipynb
Created November 7, 2022 18:10
A demo of creating a gradio app with nbdev
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hamelsmu
hamelsmu / app.ipynb
Created November 7, 2022 18:07
A demo of creating a gradio app with nbdev
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hamelsmu
hamelsmu / app.ipynb
Created November 7, 2022 17:54
A demo of creating a gradio app with nbdev
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hamelsmu
hamelsmu / app.ipynb
Created November 7, 2022 17:53
A demo of creating a gradio app with nbdev
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hamelsmu
hamelsmu / notes.ipynb
Created August 30, 2022 19:25
How docs workflow works
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hamelsmu
hamelsmu / get_validation_preds.py
Created July 3, 2022 03:57
Get Validation Predictions For Lesson 3 wandb
import wandb
import pandas as pd
from fastcore.all import Path
def val_pred_table(run_id, entity='wandb_course', proj='lemon-project'):
"Get prediction table on the validation set for the lemon project."
api = wandb.Api()
path = api.artifact(f'{entity}/{proj}/run-{run_id}-predictions_table:v0').download()
preds = (Path(path)/'predictions_table.table.json').read_json()
return pd.DataFrame([{'pred':p, 'label':t} for _,p,_,t in preds['data']])
@hamelsmu
hamelsmu / rstudio_2022.md
Last active June 9, 2022 20:10
rstudio conf 2022 nbdev talk proposal
@hamelsmu
hamelsmu / load_csv_data.py
Created May 11, 2022 03:03
Load CSV Data in Metaflow steps
from metaflow import FlowSpec, step
url = "https://raw.githubusercontent.com/Netflix/metaflow/master/metaflow/tutorials/02-statistics/movies.csv"
local_path = "./movies.csv"
class CSVFlow(FlowSpec):
@step
def start(self):
self.next(self.get_csv_from_web)
@step
@hamelsmu
hamelsmu / ghissues.sql
Last active April 28, 2022 01:47
Get Github Issues from Bigquery
-- Access this query at https://console.cloud.google.com/bigquery?sq=235037502967:a71a4b32d74442558a2739b581064e5f
SELECT url, title, body
FROM(
SELECT url, title, body
, RANK() OVER (PARTITION BY SUBSTR(body, 75, 125) ORDER BY url) as count_body_beg
FROM(
SELECT url, title, body
, RANK() OVER (PARTITION BY SUBSTR(body, 50, 100) ORDER BY url) as count_body_beg
FROM(
@hamelsmu
hamelsmu / docs_example.html
Created February 25, 2022 18:49
Example of Schema For Docs
<DocSection type="class" name="ExampleError" module="test_lib.example" link="test_lib/example.py#L155">
<SigArgSection>
<SigArg name="msg" type="str" default="foo"/>
<SigArg name="code" type="str" default="foo"/>
</SigArgSection>
<Description summary="Exceptions are documented in the same way as classes." extended_summary="The __init__ method may be documented in either the class level\ndocstring, or as a docstring on the __init__ method itself.\n\nEither form is acceptable, but the two should not be mixed. Choose one\nconvention to document the __init__ method and be consistent with it." />
<ParamSection name="Parameters">
<Parameter name="msg" type="str" desc="Human readable string describing the exception." />
<Parameter name="code" type=":obj:`int`, optional" desc="Numeric error code." />
</ParamSection>