data-ject commited on
Commit
f1babf4
·
verified ·
1 Parent(s): 11e7fea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -3,6 +3,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
3
  import torch
4
  import os
5
  from dotenv import load_dotenv
 
6
 
7
  # Load environment variables from .env file
8
  load_dotenv()
@@ -45,7 +46,8 @@ system_instruction = (
45
  "The scripts must be functional in a real-world scenario."
46
  )
47
 
48
- # Define the chat function
 
49
  def chat_function(prompt):
50
  # Create the full input prompt including the system instruction
51
  full_prompt = f"{system_instruction}\nUser: {prompt}\nAssistant:"
@@ -69,8 +71,8 @@ iface = gr.Interface(
69
  fn=chat_function,
70
  inputs="text",
71
  outputs="text",
72
- title="Hacker by Data-Ject Solutions",
73
- description="A HackingGPT created by Data-Ject Solutions",
74
  )
75
 
76
  # Launch the interface
 
3
  import torch
4
  import os
5
  from dotenv import load_dotenv
6
+ import spaces # Import the spaces module
7
 
8
  # Load environment variables from .env file
9
  load_dotenv()
 
46
  "The scripts must be functional in a real-world scenario."
47
  )
48
 
49
+ # Define the chat function and decorate it with @spaces.GPU
50
+ @spaces.GPU
51
  def chat_function(prompt):
52
  # Create the full input prompt including the system instruction
53
  full_prompt = f"{system_instruction}\nUser: {prompt}\nAssistant:"
 
71
  fn=chat_function,
72
  inputs="text",
73
  outputs="text",
74
+ title="Hacker",
75
+ description="A HackingGPT",
76
  )
77
 
78
  # Launch the interface