WillHeld commited on
Commit
6956a00
·
verified ·
1 Parent(s): 79569f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,21 +1,21 @@
1
- import torch
2
  import spaces
3
  import os
4
  import uuid
5
  import time
6
  import json
 
7
  from datetime import datetime, timedelta
8
  from threading import Thread
9
 
10
  # Gradio and HuggingFace imports
11
  import gradio as gr
12
- from gradio.themes import Base
13
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
14
  from datasets import Dataset
15
  from huggingface_hub import HfApi, login
16
 
17
  # Model configuration
18
  checkpoint = "WillHeld/soft-raccoon"
 
19
  # Set device based on availability
20
  if torch.cuda.is_available():
21
  device = "cuda"
@@ -24,7 +24,7 @@ else:
24
  print("CUDA not available, using CPU instead. This will be much slower.")
25
 
26
  # Dataset configuration
27
- DATASET_NAME = "your-username/soft-raccoon-conversations" # Change to your username
28
  SAVE_INTERVAL_MINUTES = 5 # Save data every 5 minutes
29
  last_save_time = datetime.now()
30
 
@@ -38,7 +38,7 @@ conversations = []
38
 
39
  # Hugging Face authentication
40
  # Uncomment this line to login with your token
41
- login(token=os.environ.get("HF_TOKEN"))
42
 
43
 
44
  def save_to_dataset():
 
 
1
  import spaces
2
  import os
3
  import uuid
4
  import time
5
  import json
6
+ import torch
7
  from datetime import datetime, timedelta
8
  from threading import Thread
9
 
10
  # Gradio and HuggingFace imports
11
  import gradio as gr
 
12
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
13
  from datasets import Dataset
14
  from huggingface_hub import HfApi, login
15
 
16
  # Model configuration
17
  checkpoint = "WillHeld/soft-raccoon"
18
+
19
  # Set device based on availability
20
  if torch.cuda.is_available():
21
  device = "cuda"
 
24
  print("CUDA not available, using CPU instead. This will be much slower.")
25
 
26
  # Dataset configuration
27
+ DATASET_NAME = "WillHeld/soft-raccoon-conversations" # Change to your username
28
  SAVE_INTERVAL_MINUTES = 5 # Save data every 5 minutes
29
  last_save_time = datetime.now()
30
 
 
38
 
39
  # Hugging Face authentication
40
  # Uncomment this line to login with your token
41
+ # login(token=os.environ.get("HF_TOKEN"))
42
 
43
 
44
  def save_to_dataset():