Spaces:
Sleeping
Sleeping
Georges
commited on
Commit
·
32b38b5
1
Parent(s):
171690e
switch to base model
Browse files- src/app.py +5 -3
src/app.py
CHANGED
|
@@ -1,16 +1,19 @@
|
|
| 1 |
-
from threading import Thread
|
| 2 |
from typing import Optional
|
| 3 |
import streamlit as st
|
| 4 |
import pandas as pd
|
| 5 |
import plotly.express as px
|
| 6 |
import os
|
|
|
|
| 7 |
import requests
|
| 8 |
import torch
|
| 9 |
-
from transformers import pipeline
|
| 10 |
|
| 11 |
@st.cache_resource
|
| 12 |
def model_loader():
|
| 13 |
model_name = "OrangeBottle/place_description_model_16_bit"
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
pipe = pipeline(task="text-generation", model=model_name, dtype=torch.bfloat16, device_map="cpu")
|
| 16 |
|
|
@@ -55,7 +58,6 @@ def search_location(location_name) -> Optional[dict[str, float]]:
|
|
| 55 |
latitude = location['lat']
|
| 56 |
longitude = location['lon']
|
| 57 |
|
| 58 |
-
import time
|
| 59 |
time.sleep(1) # To respect rate limiting
|
| 60 |
|
| 61 |
return {
|
|
|
|
|
|
|
| 1 |
from typing import Optional
|
| 2 |
import streamlit as st
|
| 3 |
import pandas as pd
|
| 4 |
import plotly.express as px
|
| 5 |
import os
|
| 6 |
+
import time
|
| 7 |
import requests
|
| 8 |
import torch
|
| 9 |
+
from transformers import pipeline
|
| 10 |
|
| 11 |
@st.cache_resource
|
| 12 |
def model_loader():
|
| 13 |
model_name = "OrangeBottle/place_description_model_16_bit"
|
| 14 |
+
model_name = "unsloth/Llama-3.2-3B-Instruct" # Non Fine-Tuned Base Model
|
| 15 |
+
|
| 16 |
+
st.write(f"##### Using {model_name}")
|
| 17 |
|
| 18 |
pipe = pipeline(task="text-generation", model=model_name, dtype=torch.bfloat16, device_map="cpu")
|
| 19 |
|
|
|
|
| 58 |
latitude = location['lat']
|
| 59 |
longitude = location['lon']
|
| 60 |
|
|
|
|
| 61 |
time.sleep(1) # To respect rate limiting
|
| 62 |
|
| 63 |
return {
|