aniketp2009gmail commited on
Commit
eb62466
·
verified ·
1 Parent(s): 13e45fb

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +7 -16
  2. app.py +5 -5
README.md CHANGED
@@ -1,19 +1,10 @@
1
  ---
2
- title: Phi3 Bilora Assistant
3
- emoji: 🚀
4
- colorFrom: red
5
- colorTo: red
6
- sdk: docker
7
- app_port: 8501
8
- tags:
9
- - streamlit
10
  pinned: false
11
- short_description: Streamlit template space
12
  ---
13
-
14
- # Welcome to Streamlit!
15
-
16
- Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
17
-
18
- If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
19
- forums](https://discuss.streamlit.io).
 
1
  ---
2
+ title: BiLoRA Code Assistant
3
+ emoji: "\U0001F9E0"
4
+ colorFrom: blue
5
+ colorTo: purple
6
+ sdk: streamlit
7
+ sdk_version: "1.40.0"
8
+ app_file: app.py
 
9
  pinned: false
 
10
  ---
 
 
 
 
 
 
 
app.py CHANGED
@@ -1,11 +1,12 @@
 
 
 
1
  import streamlit as st
2
  import torch
3
- import os
4
- import time
5
  import pandas as pd
6
  from transformers import AutoTokenizer, AutoModelForCausalLM
7
  from peft import PeftModel
8
- from huggingface_hub import HfApi, Table
9
 
10
  # CONFIGURATION
11
  BASE_MODEL = "microsoft/Phi-3-mini-4k-instruct"
@@ -35,7 +36,6 @@ def load_model():
35
  model.set_adapter("task_1")
36
  return model, tokenizer
37
 
38
- import datetime
39
 
40
  def log_feedback(prompt, response, task, rating):
41
  """Save feedback to a Hugging Face Dataset CSV"""
@@ -123,7 +123,7 @@ try:
123
 
124
  st.write("---")
125
  st.write("Help improve BiLoRA! Was this helpful?")
126
- col1, col2 = st.columns(5)
127
  with col1:
128
  if st.button("👍 Yes"):
129
  log_feedback(st.session_state.last_prompt, st.session_state.last_response, st.session_state.last_task, 1)
 
1
+ import datetime
2
+ import os
3
+
4
  import streamlit as st
5
  import torch
 
 
6
  import pandas as pd
7
  from transformers import AutoTokenizer, AutoModelForCausalLM
8
  from peft import PeftModel
9
+ from huggingface_hub import HfApi
10
 
11
  # CONFIGURATION
12
  BASE_MODEL = "microsoft/Phi-3-mini-4k-instruct"
 
36
  model.set_adapter("task_1")
37
  return model, tokenizer
38
 
 
39
 
40
  def log_feedback(prompt, response, task, rating):
41
  """Save feedback to a Hugging Face Dataset CSV"""
 
123
 
124
  st.write("---")
125
  st.write("Help improve BiLoRA! Was this helpful?")
126
+ col1, col2 = st.columns(2)
127
  with col1:
128
  if st.button("👍 Yes"):
129
  log_feedback(st.session_state.last_prompt, st.session_state.last_response, st.session_state.last_task, 1)