Spaces:
Runtime error
Runtime error
VenkateshRoshan
commited on
Commit
·
67d5dc2
1
Parent(s):
e05da78
port update
Browse files
app.py
CHANGED
|
@@ -50,6 +50,8 @@ class CustomerSupportBot:
|
|
| 50 |
self.device = "cpu" #"cuda" if torch.cuda.is_available() else "cpu"
|
| 51 |
self.model = self.model.to(self.device)
|
| 52 |
|
|
|
|
|
|
|
| 53 |
def generate_response(self, message: str, max_length=100, temperature=0.7) -> str:
|
| 54 |
try:
|
| 55 |
input_text = f"Instruction: {message}\nResponse:"
|
|
@@ -120,7 +122,7 @@ def create_chat_interface():
|
|
| 120 |
label="Chat History",
|
| 121 |
height=500,
|
| 122 |
elem_classes="message-box",
|
| 123 |
-
type="messages"
|
| 124 |
)
|
| 125 |
|
| 126 |
with gr.Row():
|
|
@@ -169,6 +171,7 @@ def create_chat_interface():
|
|
| 169 |
|
| 170 |
if __name__ == "__main__":
|
| 171 |
demo = create_chat_interface()
|
|
|
|
| 172 |
demo.launch(
|
| 173 |
share=False,
|
| 174 |
server_name="0.0.0.0", # Makes the server accessible from other machines
|
|
|
|
| 50 |
self.device = "cpu" #"cuda" if torch.cuda.is_available() else "cpu"
|
| 51 |
self.model = self.model.to(self.device)
|
| 52 |
|
| 53 |
+
print(f'Model loaded on device: {self.device}')
|
| 54 |
+
|
| 55 |
def generate_response(self, message: str, max_length=100, temperature=0.7) -> str:
|
| 56 |
try:
|
| 57 |
input_text = f"Instruction: {message}\nResponse:"
|
|
|
|
| 122 |
label="Chat History",
|
| 123 |
height=500,
|
| 124 |
elem_classes="message-box",
|
| 125 |
+
# type="messages"
|
| 126 |
)
|
| 127 |
|
| 128 |
with gr.Row():
|
|
|
|
| 171 |
|
| 172 |
if __name__ == "__main__":
|
| 173 |
demo = create_chat_interface()
|
| 174 |
+
print("Starting Gradient server...")
|
| 175 |
demo.launch(
|
| 176 |
share=False,
|
| 177 |
server_name="0.0.0.0", # Makes the server accessible from other machines
|