Spaces:
Runtime error
Runtime error
Commit History
-
Remove unneeded load_learner
Dane Summersc105490 -
Adds title, description, and examples.
Dane Summers325c700 -
fixes function typo
Dane Summersacf24a0 -
Load the model from huggingface
Dane Summers90fc31d
-
Removes model export from git
Dane Summers0a6e65f -
Use openai learner to predict bear type.
Dane Summers5bba94e -
aider: Modify Gradio interface to accept an image as input, call `predict_bear_type` with the image, and display the prediction.
Dane Summers# Aider chat conversation: USER: Change the gradio interface to accept an image, call `predict_bear_type` and then show the prediction. ASSISTANT: Sure, I will modify the Gradio interface to accept an image as input, call the `predict_bear_type` function with the image, and then display the prediction. Here are the changes: ```python app.py <<<<<<< HEAD def greet(): return "Hello, World!" iface = gr.Interface(fn=greet, inputs=[], outputs="text") iface.launch() ======= def greet(img_path): return predict_bear_type(img_path) iface = gr.Interface(fn=greet, inputs="image", outputs="text") iface.launch() >>>>>>> updated ``` This code changes the `greet` function to accept an image path and return the result of calling `predict_bear_type` with the image path. The Gradio interface is updated to accept an image as input and display text as output. The interface calls the `greet` function when an image is submitted.4aa1057 -
aider: Created a function `predict_bear_type(img_path)` that opens the image at the given path, converts it to a PILImage, and uses the learner to predict the type of bear in the image.
Dane Summers# Aider chat conversation: USER: create a function called predect_bear_type(img) that accepts a path to an image, converts it to a PILImage and uses the learner to predict what the image is. ASSISTANT: Sure, I will create a function `predict_bear_type(img)` that accepts a path to an image, converts it to a PILImage, and uses the learner to predict the type of bear in the image. We need to import the `PILImage` class from the `fastai.vision.core` module and the `open_image` function from the `PIL` module. The `predict_bear_type` function will open the image, convert it to a PILImage, and then pass it to the `predict` method of the learner. Here are the changes: ```python app.py <<<<<<< HEAD import gradio as gr from fastai.learner import load_learner learner = load_learner('export.pkl') def greet(): return "Hello, World!" iface = gr.Interface(fn=greet, inputs=[], outputs="text") iface.launch() ======= import gradio as gr from fastai.learner import load_learner from fastai.vis…bdfca3e -
aider: Load a fastai learner from `export.pkl` in `app.py`.
Dane Summers# Aider chat conversation: USER: Modify `app.py` to load a fastai learner from export.pkl ASSISTANT: To load a fastai learner from `export.pkl`, we need to import the `load_learner` function from the `fastai.learner` module. Then we can call this function with the path to `export.pkl`. Here are the changes: ```python app.py <<<<<<< HEAD import gradio as gr def greet(): return "Hello, World!" iface = gr.Interface(fn=greet, inputs=[], outputs="text") iface.launch() ======= import gradio as gr from fastai.learner import load_learner learner = load_learner('export.pkl') def greet(): return "Hello, World!" iface = gr.Interface(fn=greet, inputs=[], outputs="text") iface.launch() >>>>>>> updated ``` This code will load the learner when the script is run. The learner is then available for use in the `greet` function or any other function in the script.27e2a2c -
Adds fastai dependency
Dane Summersdae967d -
Adds trained model from https://www.kaggle.com/danesummers/deep-learning-lesson-2/edit
Dane Summersacc9bbb -
aider: Added hello world Gradio app in `app.py`.
Dane Summers# Aider chat conversation: USER: Make a hello world Gradio app in `app.py` ASSISTANT: Sure, I will create a simple Gradio app that displays "Hello, World!" when run. Here is the code: ```python app.py <<<<<<< HEAD ======= import gradio as gr def greet(): return "Hello, World!" iface = gr.Interface(fn=greet, inputs=[], outputs="text") iface.launch() >>>>>>> updated ``` This code creates a Gradio interface with no inputs and a text output. The function `greet` returns the string "Hello, World!". The interface is then launched with `iface.launch()`. When you run this script, it will start a web server and print a URL you can visit in your web browser to interact with the app.063df12 -
initial commit
595ac61